Our team uses hooks and context for everything, and a little bit of legacy redux usage.
Our team uses hooks and context for everything, and a little bit of legacy redux usage.
You don't need to put the username of the logged in user into Redux, but if multiple components across different pages need to access this data, you should make it globally accessible.
You can choose Redux/MobX for this, or you can roll your own solution with context and hooks.
I'm actually learning more about the context/hooks approach myself.
Kent C Dodd wrote a great article on this topic I'd recommend:
https://kentcdodds.com/blog/application-state-management-wit...
https://redux.js.org/faq/organizing-state#do-i-have-to-put-a...
We're currently working on a major rewrite of the Redux core docs, and will emphasize this thought process in more areas of the docs as we go.
Client state management is all global no matter the strategy. ie Component level stores are effectively namespacing a global space with more cruft.
When you get into sets of components, the convenient store gets ugly/brittle no matter how you do it, so might as well keep it in a single store.