Reputation: 43
I am working on a native runtime app, and am new to using redux in my react applications. Is is best practice to store ALL state in the redux store, or should I only store state that I know I need to access anywhere, and then continue to write state inside of components that I know are only needed inside of that specific component.
I guess my question really is, how do I determine what state to store inside of components, and which state to store inside of the redux store?
Upvotes: 1
Views: 628
Reputation: 49
if a state uses more than two screens then you should use redux , for example customer name , you can see it on home screen and profile screen you can use redux , when you change information in the personal information screen, the home screen will be updated.
state should only be used in 1 component
Hope the answer helps you!
Upvotes: 1