Closed djMax closed 1 year ago
I saw those, but that seems like it conflates the states into one big container, no?
I saw those, but that seems like it conflates the states into one big container, no?
yes, and it is left the responsibility to you to destruct what you need in order to handle component rerendering.
That would cause a bunch of over-rendering, no? Or is it going to happen anyways?
That would cause a bunch of over-rendering, no? Or is it going to happen anyways?
I don't remember for those examples but it might if you don't control it with useCallbacks, useMemos and memos as any other hook solution would probably. There are some solutions which come ready for this type of situations, I guess this isn't one of them.
I'm just confused what the difference is between the explicit and the wrapped versions I posted. It should just be adding an entry to the hierarchy, not altering it so fundamentally.
I have a react-native app and I'm just trying to simplify the code structure slightly by changing:
To something like:
However, I get the telltale error
Error: Component must be wrapped with <Container.Provider>
. I don't understand what's different about it - I've tried "simple" composition (with a children prop) as well as this HOC, both fail in the same way.