MCPcopy Create free account
hub / github.com/Klerith/react-hooks / onInputChange

Function onInputChange

src/hooks/useForm.js:7–13  ·  view source on GitHub ↗
({ target })

Source from the content-addressed store, hash-verified

5 const [ formState, setFormState ] = useState( initialForm );
6
7 const onInputChange = ({ target }) => {
8 const { name, value } = target;
9 setFormState({
10 ...formState,
11 [ name ]: value
12 });
13 }
14
15 const onResetForm = () => {
16 setFormState( initialForm );

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected