Hey Vorillaz, thanks for this great article. I had some doubts regarding using use-context-selector in the production. now I see you benefit from it, I have more courage to test that in my application.
Also, I think there is a small issue in your Provider; you are using useCallback(() => setState(), []) but the setState function returned from the useState hook is guaranteed to not change at all and memoizing it is not useful at all.
Also, check the react-tracked library. it's from the same author as the use-context-selector and has a nice API alongside all of these performance optimizations out of the box.
Hey Eddie, thanks a lot for the feedback. Looking forward for the results of your effort and thanks a lot for the suggestions I’ll definitely have a look.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Hey Vorillaz, thanks for this great article. I had some doubts regarding using use-context-selector in the production. now I see you benefit from it, I have more courage to test that in my application.
Also, I think there is a small issue in your Provider; you are using
useCallback(() => setState(), [])
but the setState function returned from the useState hook is guaranteed to not change at all and memoizing it is not useful at all.Also, check the
react-tracked
library. it's from the same author as theuse-context-selector
and has a nice API alongside all of these performance optimizations out of the box.Hey Eddie, thanks a lot for the feedback. Looking forward for the results of your effort and thanks a lot for the suggestions I’ll definitely have a look.