mirror of
https://github.com/reactjs/react.dev.git
synced 2026-02-24 20:53:08 +00:00
I -> we (#8817)
This commit is contained in:
committed by
Dan Abramov
parent
aa9abe5fde
commit
e8b5156d1a
@@ -207,7 +207,7 @@ Square no longer keeps its own state; it receives its value from its parent `Boa
|
||||
|
||||
## Why Immutability Is Important
|
||||
|
||||
In the previous code example, I suggest using the `.slice()` operator to copy the `squares` array prior to making changes and to prevent mutating the existing array. Let's talk about what this means and why it is an important concept to learn.
|
||||
In the previous code example, we suggest using the `.slice()` operator to copy the `squares` array prior to making changes and to prevent mutating the existing array. Let's talk about what this means and why it is an important concept to learn.
|
||||
|
||||
There are generally two ways for changing data. The first method is to *mutate* the data by directly changing the values of a variable. The second method is to replace the data with a new copy of the object that also includes desired changes.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user