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