A lot of my components change how they behave based on if the user is logged in or not.
The user is logged in when the local storage has a valid jwt token.
I can add an 'isLoggedIn' boolean to the states of all components that care about this and initialise it but this introduces a lot of redundancy.
Is there a way to have a global prop or state which all components can easily access to take care of this? Perhaps even in the future beyond 'isLoggedIn' I would have other information about the user such as username and things?
window.jwt? If so, just read directly from there. You don't need to have that in your state.