How can I update a local state and then access the updated value within the same function scope?
I am trying to update the store in redux, I am taking values from a local state, I'm doing this from inside the same functional scope that the state is being updated in. when I do this, the pre-updated value of the local state is being passed to the store
I have tried adding a useEffect to the code which watches the state to try and make it update the value of the state in the function scope, but it doesn't work.
Because we are having one button do everything at once, it is all wrapped in one function. I'm sure the solution is using async/await, but I am not so hot with that!