Not every kind of state needs to go to Redux

Only some kinds of state need to be in Redux,

  • State that’s shared by multiple components on the same page
    • State that’s read by multiple components
    • State that’s written by one component and read by another
  • State whose lifecycle is longer than its component. For example, “recordList” for a list page – If you go to a detail page from a list page, and then come back, you don’t want to re-fetch the list from the backend. With “recordList” in redux you can just read it from the Redux store.

Typical cases that you don’t need Redux for you state:

  • Form values – And this is why Formix is better than Redux-Form
  • “currentRecord” for a detail page

Leave a Comment

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.