reagir atualização funcional de uso usestate
() => setCount(prevCount => prevCount - 1)
nk4j
() => setCount(prevCount => prevCount - 1)
// declare state using useState hook.
// someState is set to someInitialState
const [someState, setSomeState] = useState(someInitialState);
// setSomeState updates the current state
setSomeState(someOtherState);