Premium Only Content
Add Text Input Box to Send a Message in React App
The lecture goes over the implementation of the text field and send button that appears in the bottom of the chat room container.
An input element of type attribute text is used for the text box.
A button element of type attribute button is used for the send action.
Since you cannot return more than one thing, you have to enclose the input and button elements inside another element.
You can return multiple things if you enclose them in an array.
Another standard way is enclosing the multiple elements in a container element such as a div.
In React, you can also enclose them in a Fragment component, which eliminates the intermediate div container in the DOM.
Some people write the Fragment with just an empty set of angle brackets with nothing in between.
Some Cascading Style Sheets (CSS) is written to polish the style of the text input and send button.
-
DVR
iCkEdMeL
56 minutes ago🔴 Anna Kepner Case: 3AM Warning and Cabin Screaming Reveal Terrifying Timeline
8 -
26:47
Degenerate Jay
4 hours agoPlaying Fallout 3 For The First Time Ever - Here's My Thoughts
661 -
59:25
Jeff Ahern
3 hours ago $7.36 earnedThe Saturday Show with Jeff Ahern
60.1K13 -
29:53
Afshin Rattansi's Going Underground
2 days agoBRICS MUST Replace the US’ Authoritarian International Financial System! (Prof. Steve Keen)
4.65K12 -
31:27
Robbi On The Record
3 days ago $9.58 earnedWhat the Bible say about Astrology.. The Conversation Culture Has Been Avoiding | ft. JT Follows JC
38.8K10 -
17:38
Professor Nez
3 hours ago🚨THIS IS A NATIONAL SECURITY EMERGENCY: Stephen Miller with CHILLING WARNING for AMERICA
38K94 -
LIVE
tminnzy
2 hours agoBLACK OPS 7 MULTIPLAYER ROAD TO MASTER PRESTIGE
113 watching -
47:10
The Rubin Report
7 hours agoWhat Really Happened on ‘The View’ & ‘Curb Your Enthusiasm’ | Cheryl Hines
183K44 -
3:08:37
LumpyPotatoX2
6 hours agoWhere Winds Meet: New Level Cap + Rumble Wallet - #RumbleGaming
37.4K1 -
3:46:45
SOLTEKGG
4 hours ago🔴LIVE - Battlefield 6 - Going Pro in RED SEC
27.7K