loading...

React Tldr; Basic concepts of normalizing data

maniekm profile image Mariusz Updated on ・1 min read
  • 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

Discussion

markdown guide