react setstate syntax code example
Example 1: setstate in react
Functional Component
const [counter, setCounter] = useState(0);
setCouter(counter + 1);
Example 2: react setState
this.setState({
date: new Date()
});
Example 3: set state
setState({ searchTerm: event.target.value })