In a class-based component when one would set the state, it would take the argument of the new state and sometimes one could fire another function within it. In a functional-based component, using hooks, how can I accomplish the same goal?
// class-based componenet example:
state = {
count: 0
}
this.setState({
count: count +1
}, () => someFunction())
// functional-based componenet example:(how to fire someFunction() when the state is set like in the class-based componenet?)
const [count, setCount] = useState(0)
setCount(count +1)
I'm aware that hooks don't take a second argument but can something similar be done?