Answer the question
In order to leave comments, you need to log in
How to properly style slicing architecture when using redux-toolkit in react.js?
There is a big application where React Context is used. I decided to transfer state management to Redux-Toolkit. When using Context there was the following structure. There were sections, for example, an authorization section, a personal account section, etc. A context was created and all section contexts wrapped the root component. At the moment, I can’t figure out how to properly make slices in Redux-toolkit, either to make a large slice for each section, or to connect slices locally to a specific component.
Answer the question
In order to leave comments, you need to log in
If all business logic is taken out of the React Context in the Redux Toolkit, then locally connect slices to a specific component. And in most cases, in my opinion, it is better to organize the architecture in this way, of course, there can always be exceptions or some kind of limitations.
For example, if the application has some kind of stepper, then the data will be requested only when a certain component is loaded, and if the user does not reach any step, then once again the data will not have to be requested from the server.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question