Created
August 10, 2020 17:41
-
-
Save chetanraj/eba8f04d207599d15630c022f432560e 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
const Input = () => { | |
const [name, setName] = useRecoilState(nameStateAtom); | |
const onChange = (event) => { | |
setName(event.target.value); | |
}; | |
return ( | |
<div className="input"> | |
<input placeholder="Enter name" type="text" value={name} onChange={onChange} /><br /> | |
<div className="comment">The state is shared using <a href="https://recoiljs.org/">recoil</a></div> | |
</div> | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment