Kind of a general question. How do you share state between tabs? I’ve used context wrapping the whole router that contains state for all components that share state between pages. (Think user interacetion on tab1 affects components on both tab1 and tab2).
The problem with this is that it redraws all components on the page even though they are not using the shared state. This is because the context wraps the whole page. I need to wrap the whole router including all the pages with context because the context is shared.
I tried using this solution: How to Dispatch an Action to Update a Sibling in React | by Fang Jin | JavaScript in Plain English
But this requires that the components be pre-drawn which gets really messy.
Any ideas?
1 post - 1 participant