useInput.js 249 Bytes Raw Blame History Permalink 1 2 3 4 5 6 7 8 9 10 11 12 13 14 import { useState } from "react"; export default (defaultValue) => { const [value, setValue] = useState(""); const onChange = (e) => { const { target: { value }, } = e; setValue(value); }; return { value, onChange }; };