I want to dispatch an action to update my application's global state with the currently signed in user. When a user clicks a button, an event handler fires that is registered in mapDispatchToProps
, and then I want to dispatch an action (article.updateAuthor(currentUser)
). However, In mapDispatchToProps
I have no access to the state to get the current user, and I do not want to arbitrarily pass the currently signed in user to a component prop -- only to be passed to the click event above, which will then pass the user data to a dispatched action.
I know I can dispatch an action with a redux thunk which gives me access to the state. However, this seems rather heavy handed seeing as there are no API calls being made.
Has anyone ran into this problem before?