You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hope learning react is going okay, having a look through the code and I noticed that here you are cloning an object by JSON.stringifying then parsing a simpler and arguably more readably solution would be to use Object spread notation... (not sure if your current build strategy supports it) example: let objClone = { ...obj };
The text was updated successfully, but these errors were encountered:
Yeah it does do shallow copying, but in this case that would be fine. If you have nested objects/arrays you would need to do something a bit more complex
Hi,
Hope learning react is going okay, having a look through the code and I noticed that here you are cloning an object by
JSON.stringify
ing then parsing a simpler and arguably more readably solution would be to use Object spread notation...
(not sure if your current build strategy supports it) example:let objClone = { ...obj };
The text was updated successfully, but these errors were encountered: