Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

handlechange in react

const [data, setData] = useState({
    name: "",
  });
const handleData = (name, value) => {
    setData({
      ...data,
      [name]: value,
    });
  };
onChange={(e) => handleData("name", e.target.value)}
 
PREVIOUS NEXT
Tagged: #handlechange #react
ADD COMMENT
Topic
Name
6+4 =