sdy

create useInput

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