Quantcast
Channel: Ionic Forum - Latest topics
Viewing all articles
Browse latest Browse all 70818

Share state across tabs with context, but without unnecessary redraws?

$
0
0

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

Read full topic


Viewing all articles
Browse latest Browse all 70818

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>