Premium Only Content

Insert Message from React Controlled Input Component Value
The lecture goes over taking what the user typed and adding that to the list of messages.
The input element is turned into a React controlled component with the setting of value and onChange props.
The value of the input comes from a state variable. The useState hook can be used to tell React to track a certain value.
The onChange is a function definition with instructions to mutate the state for the new message that is typed into the text box.
Given an event object, you can access the input text using the value property of the target property.
Be careful about replacing existing React state whenever you call a set function from useState hook. In many cases, you might want to take the existing value and append to it, instead of replacing everything.
-
13:48
SLS - Street League Skateboarding
2 hours agoYuto Horigome's Best Moments in Tokyo - SLS 2023 & 2024
122 -
LIVE
The Tom Renz Show
48 minutes agoHarvard, 9/11, the DOJ and Much More!
190 watching -
1:04:48
Timcast
2 hours agoMangione COPYCAT Arrested Outside UnitedHealth HQ, Leftists Are ESCALATING TERROR
108K97 -
2:09:29
Right Side Broadcasting Network
5 hours agoLIVE: Karoline Leavitt Holds a White House Press Briefing - 4/15/25
56.6K23 -
1:58:11
The Charlie Kirk Show
2 hours agoBury Harvard + Defund NPR + The "Maryland Dad" Lie | Vought, Davis, Kane | 4.15.25
38.4K7 -
43:40
Winston Marshall
3 hours ago30 Politically Motivated Deaths in 2025 So Far…Tim Pool Uncovers Civil Strife in America
22K7 -
1:07:33
Rebel News
1 hour ago $0.61 earnedPoilievre on defunding CBC, Carney on climate change, PPC candidate's bank frozen | Rebel Roundup
6.73K5 -
1:14:51
Flyover Conservatives
3 hours agoRUSSIAGATE: Steele Dossier was FAKE the Whole Time... and They Knew It! - Hans Mahncke | FOC Show
18.1K1 -
DVR
TheAlecLaceShow
5 hours agoGuest: Mayor JD Longo | Bukele Visits Trump | Assassination Plots | Tax Day | The Alec Lace Show
9.31K -
38:18
Grant Stinchfield
2 hours ago $1.55 earnedCDC Records Vanish: Top Vaccine Safety Administrator's Files Missing Amid Federal Probe
18.1K12