hooks-react-useforms
v0.1.5
Published
make easy to react form
Downloads
5
Maintainers
Readme
useInput
import
import { useInput } from 'react';
API
const [state, setStateFunc, changeFunc] = useInput("initialValue");
const App = () => {
const [id, setId, changeId] = useInput("");
const [password, setPassword, changePassword] = useInput("");
return (
<>
<input
type="text"
name="id"
value={id}
onChange={changeId}
/>
<input
type="password"
name="password"
value={password}
onChange={changePassword}
/>
</>
);
}