If you have as many actions as usually you have in redux this might get quite expensive as every change will recreate all those actions and all components that depend on any of the action or any of the state. That is a fundamental difference between redux and context. Redux handles memoization well and selects only what you need. Also you create actions only once and not multiple times. So because the dispatch function never changes, so should also the actions never change.
Use it for state that does not change often - stuff like theme preference, language preference. Context is not a state management solution, it's a dependency injection mechanism
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.
If you have as many actions as usually you have in redux this might get quite expensive as every change will recreate all those actions and all components that depend on any of the action or any of the state. That is a fundamental difference between redux and context. Redux handles memoization well and selects only what you need. Also you create actions only once and not multiple times. So because the dispatch function never changes, so should also the actions never change.
so what will be better efficient way of using context in enterprise projects
Use it for state that does not change often - stuff like theme preference, language preference. Context is not a state management solution, it's a dependency injection mechanism