From e698f2f30c64897ec345d5109f00fc493af34331 Mon Sep 17 00:00:00 2001 From: Jabriel <15688641+jukrb0x@users.noreply.github.com> Date: Wed, 19 Oct 2022 22:19:43 +0800 Subject: [PATCH] [beta] broken links in updating-objects-in-state (#5190) * fix: broken link for render-and-commt * fix(beta): broken link to `/apis/react/memo` --- beta/src/content/learn/updating-objects-in-state.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/beta/src/content/learn/updating-objects-in-state.md b/beta/src/content/learn/updating-objects-in-state.md index 46702208..d461f117 100644 --- a/beta/src/content/learn/updating-objects-in-state.md +++ b/beta/src/content/learn/updating-objects-in-state.md @@ -788,7 +788,7 @@ Notice how much more concise the event handlers have become. You can mix and mat There are a few reasons: * **Debugging:** If you use `console.log` and don't mutate state, your past logs won't get clobbered by the more recent state changes. So you can clearly see how state has changed between renders. -* **Optimizations:** Common React [optimization strategies](/api/react/memo) rely on skipping work if previous props or state are the same as the next ones. If you never mutate state, it is very fast to check whether there were any changes. If `prevObj === obj`, you can be sure that nothing could have changed inside of it. +* **Optimizations:** Common React [optimization strategies](/apis/react/memo) rely on skipping work if previous props or state are the same as the next ones. If you never mutate state, it is very fast to check whether there were any changes. If `prevObj === obj`, you can be sure that nothing could have changed inside of it. * **New Features:** The new React features we're building rely on state being [treated like a snapshot.](/learn/state-as-a-snapshot) If you're mutating past versions of state, that may prevent you from using the new features. * **Requirement Changes:** Some application features, like implementing Undo/Redo, showing a history of changes, or letting the user reset a form to earlier values, are easier to do when nothing is mutated. This is because you can keep past copies of state in memory, and reuse them when appropriate. If you start with a mutative approach, features like this can be difficult to add later on. * **Simpler Implementation:** Because React does not rely on mutation, it does not need to do anything special with your objects. It does not need to hijack their properties, always wrap them into Proxies, or do other work at initialization as many "reactive" solutions do. This is also why React lets you put any object into state--no matter how large--without additional performance or correctness pitfalls.