this.setstate in react for class based components code example
Example: setstate in react
Functional Component
const [counter, setCounter] = useState(0);
setCouter(counter + 1);
Functional Component
const [counter, setCounter] = useState(0);
setCouter(counter + 1);