Answers for "react check if focused"

2

react check if focused

function Input(props) {
  const [hasFocus, setFocus] = useState(false);

  return (
    <input
      {...props}
      onFocus={() => setFocus(true)}
      onBlur={() => setFocus(false)}
    />
  );
}
Posted by: Guest on July-15-2021

Code answers related to "react check if focused"

Code answers related to "Javascript"

Browse Popular Code Answers by Language