I\'ve been trying to understand what is the correct way to update the state of a functional component from inside a nested arrow function. Inside, these functions the state