Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

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}
      />
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #Handle #input #React #hooks
ADD COMMENT
Topic
Name
9+1 =