Search posts, tags, users, and pages
Using Immer package to simplify updating objects in state.
GAURAV BURANDE
@gauravvan · India
Web development
I am a web developer.
Markdown supported · ⌘↵ to post
A dumb way to copy an object is using the spread operator.
Instead use JSON.parse(JSON.stringify(object)) or JS has a new global function for cloning, checkout structuredClone() developer.mozilla.org/en-US/docs/Web/API/structur…
GAURAV BURANDE
A dumb way to copy an object is using the spread operator.
Instead use JSON.parse(JSON.stringify(object)) or JS has a new global function for cloning, checkout structuredClone() developer.mozilla.org/en-US/docs/Web/API/structur…