So let's say I have 3 reducers (providers) and 2 UI components, I have to wrap every single component for 3 times (3 providers) if I want to use all stores in these components?
ROFL as I was writing this I actually figure out how great this is, I still wanna post this tho 😅😅, let's assume I only want to use providers 1 and 2 in comp1, I just have to move Component1 by 1 line up, there is no need to wrap it in provider3 if it won't use any features from it.
This provider actually acts like that connect function from redux right?
Great article BTW, I didn't really have time to test hooks until now, and I am glad I did now, and run into this post it was really helpful!!
Hey Mario,
Sorry for the late reply. You don't have to wrap all the components separately. Also yes there's no need to wrap the 3rd component. The provider is similar to connect function, in Redux we generally combine the reducers.
So let's say I have 3 reducers (providers) and 2 UI components, I have to wrap every single component for 3 times (3 providers) if I want to use all stores in these components?
What happens if I wrap both components together? I mean is that the right way to do it? Are there any performance issues or something?
ROFL as I was writing this I actually figure out how great this is, I still wanna post this tho 😅😅, let's assume I only want to use providers 1 and 2 in comp1, I just have to move Component1 by 1 line up, there is no need to wrap it in provider3 if it won't use any features from it.
This provider actually acts like that connect function from redux right?
Great article BTW, I didn't really have time to test hooks until now, and I am glad I did now, and run into this post it was really helpful!!
Hey Mario,
Sorry for the late reply. You don't have to wrap all the components separately. Also yes there's no need to wrap the 3rd component. The provider is similar to connect function, in Redux we generally combine the reducers.
Hey Ankit,
Thanks for your response to the above question by Mario. What is the best way to wrap the without incurring performance issues? Thanks