(initialState)
| 1 | import { useState } from "react"; |
| 2 | |
| 3 | export function useFormFields(initialState) { |
| 4 | const [fields, setValues] = useState(initialState); |
| 5 | |
| 6 | return [ |
| 7 | fields, |
| 8 | function (event) { |
| 9 | setValues({ |
| 10 | ...fields, |
| 11 | [event.target.id]: event.target.value, |
| 12 | }); |
| 13 | }, |
| 14 | ]; |
| 15 | } |
nothing calls this directly
no outgoing calls
no test coverage detected