Skip to content

fullstackmommy/react-state-update

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

React State Update Lab

Learning how to update a state with nested objects

  1. Fork this repo to your github account and clone it to your desktop
  2. Npm install

Part 1:

Talk about the issue faced

Part 2

  • Install lodash library
  • Navigate to lodash documentation and locate cloneDeep()
  • Import lodash and use cloneDeep() instead of spread operator [... ] to resolve the issue
  • Prove that it is fixed
  • Commit your changes

Part 3

  • Install immer library
  • Navigate to immer documentation and locate produce()
  • Import immer and use produce() instead of cloneDeep() to resolve the issue
  • Prove that it is fixed
  • Commit your changes

About

Example on immutable state update

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 79.7%
  • HTML 16.4%
  • CSS 3.9%