React documentation states the following:
And therefore they recommend using the callback form of setState where you can access the most up-to-date prop.
this.setState((state, props) => ({
counter: state.counter + props.increment
}));
However, how can the same be done using hooks? namely, useState. How can I access the most up-to-date prop using useState?