Created
November 13, 2021 04:49
-
-
Save techomoro/739d459ad92dbca8241607955654a2d9 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
import React from "react"; | |
import { useRecoilState } from "recoil"; | |
import { nameState } from "../atoms/name"; | |
export default function InputComponent() { | |
const [name, setName] = useRecoilState(nameState); | |
let handleChangeInput = (e) => { | |
setName(e.target.value); | |
}; | |
return ( | |
<input | |
type="text" | |
placeholder="Enter the string" | |
onChange={handleChangeInput} | |
value={name} | |
/> | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment