Created
April 18, 2024 19:02
-
-
Save cmdcolin/4eeb22072878cf9b86a6525e1720dc5d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// this is a controlled component | |
function MyTextBox() { | |
const [myValue, setMyValue] = useState('initial value') | |
return <input type="text" value={myValue} onChange={event=>setMyValue(event.target.value)}/> | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment