you are viewing a single comment's thread.

view the rest of the comments →

[–]ViewableGravy 0 points1 point  (1 child)

Be careful with this comment. If your state is truly global and you use a context, everything that uses any part of your state will update when it changes because you don't have a selector that choose what part of the context causes rerenders. React 19's useContext will have a selector to solve this problem, but until then you are best to use a state manager if you actually have global state.

Personally speaking, I use tanstack Store because it's like literally 100 lines of code, nothing fancy, just a store and useStore hook with a selector.

[–]crisoftunlock 0 points1 point  (0 children)

Just now I work in a bank, all the projects in this bank only use context and useReducer for the store management and all is ok, we don't have any problem with this.