Created
March 1, 2019 00:58
-
-
Save flatlinediver/9865778de8f25b835e16647498a1b824 to your computer and use it in GitHub Desktop.
Handling input using React Hooks
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
import React, {useState} from 'react' | |
export const Input = () => { | |
const [ inputValue, setinputValue ] = useState() | |
const handleChange = ({ target: {value} }) => setinputValue(value) | |
return( | |
<input name='name' value={ inputValue } onChange={ handleChange }/> | |
) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment