We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 845a8c6 commit 69ee704Copy full SHA for 69ee704
README.md
@@ -209,3 +209,14 @@ On this page you learned:
209
210
<br>
211
212
+
213
+### Updating Arrays in State
214
215
+- You can put arrays into state, but you can’t change them.
216
+- Instead of mutating an array, create a _new_ version of it, and update the state to it.
217
+- You can use the `[...arr, newItem]` array spread syntax to create arrays with new items.
218
+- You can use `filter()` and `map()` to create new arrays with filtered or transformed items.
219
+- You can use Immer to keep your code concise.
220
221
+*link: https://react.dev/learn/updating-arrays-in-state*
222
0 commit comments