Adding localStorage data to state.theme value

i have a component that allows a user to select an option from a dropdown menu. The user’s selected is being set to localStorage, but i am wanting that localStorage value to be accessible to all other components in the project. I am thinking the way to make it globally accessible is to set a state.theme value equal to the value of the localStorage value. do you think this is an appropriate way of accomplishing the goal, and if so, how would i set a state.theme value to the localStorage value?

state.theme.myValue = localStorage.getItem(‘myValue’), in afterCSR.
Also useEffect to update, if needed.

I’m closing this thread because this is a duplicated topic with

Answer to the questions provided there