I'm new to React and I have the following problem:
I have three components extends Component
that I need to communicate.
They are a NavBar and two static contents.
The contents of NavBar (text and icons) are changed according to the content (component) that is loaded.
The solution I found to update the NavBar was window.localStorage
since they are I can not leave the contents as child components of NavBar.
The render()
of NavBar is conditional for each item of localStorage
.
The localStorage
item is being updated normally but it is not rendered on the screen.
Is there any way to change state
of components
that are siblings and not children so you do not need to use localStorage
?