Sitemap
May 19, 2022

Yes, definitely it does. You have to set up some mechanism to prevent the re-render of the whole app.

The package described in this story does it. You can view this feature on the demo page here: https://spyna.github.io/react-context-hook/.

Actually, the mechanism used is implemented in reverse: a subscription system to changes in the state is used, which forces a re-render if something has changed. If you are interested in the code, you can see it here: https://github.com/Spyna/react-context-hook/blob/master/src/useStore.js#L11

Lorenzo Spyna
Lorenzo Spyna

Written by Lorenzo Spyna

💻Writes web2 and web3 code | 🚀 firenze.dev co-founder | 🥑 0xpolygon Advocate — https://spyna.it

No responses yet