DEV Community

Mariusz
Mariusz

Posted on • Edited on

React Tldr; Basic concepts of normalizing data

  • Each type of data gets its own "table" in the state.
  • Each "data table" should store the individual items in an object, with the IDs of the items as keys and the items themselves as the values.
  • Any references to individual items should be done by storing the item's ID.
  • Arrays of IDs should be used to indicate ordering.
  • Use "Normalizr" library if you want to automate the normalization process

Source: https://redux.js.org/recipes/structuring-reducers/normalizing-state-shape

Top comments (0)