Answers for "input onchange hooks add"

0

Handle an input with React hooks

const [inputValue, setInputValue] = React.useState("");

      const onChangeHandler = event => {
        setInputValue(event.target.value);
      };

      <input
        type="text"
        name="name"
        onChange={onChangeHandler}
        value={inputValue}
      />
Posted by: Guest on August-17-2021
0

react hooks html imput on change

const [username, userInput] = useInput({ type: "text" });
 const [password, passwordInput] = useInput({ type: "text" });

 return <>
   {userInput} -> {username} <br />
   {passwordInput} -> {password}
 </>;
Posted by: Guest on August-24-2021

Browse Popular Code Answers by Language