---
title: "Discussion on \"Why shallow copying nested state objects in React can cause bugs?\" | Hashnode"
description: "Discussion on \"Why shallow copying nested state objects in React can cause bugs?\". Deep copy your state object whenever you want to change its nested properties."
url: "https://hashnode.com/posts/why-shallow-copying-nested-state-objects-in-react-can-cause-bugs/627fe9be0094f2f13f51497e"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Why shallow copying nested state objects in React can cause bugs?](https://randomness.hashnode.dev/why-shallow-copying-nested-state-objects-in-react-can-cause-bugs?utm_source=hashnode&utm_medium=feed)

Deep copy your state object whenever you want to change its nested properties.

May 14, 2022 · 4 min read · randomness.hashnode.dev  
Read the article

-   [#reactjs](https://hashnode.com/tag/reactjs)
-   [#javascript](https://hashnode.com/tag/javascript)
-   [#thw-web-apps](https://hashnode.com/tag/thw-web-apps)

## Written by

[Jai A](https://hashnode.com/@randomreact)

@randomreact · India

  
[View profile](https://hashnode.com/@randomreact)

Figuring my way in the tech world.

Software Developer. I write about my learnings here.

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
