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
You don't need to wrap every component into a separate Error Boundary. When you think about the [granularity of Error Boundaries,](https://www.brandondail.com/posts/fault-tolerance-react) consider where it makes sense to display an error message. For example, in a messaging app, it makes sense to place an Error Boundary around the list of conversations. It also makes sense to place one around every individual message. However, it wouldn't make sense to place a boundary around every avatar.
1345
-
1346
-
<Note>
1347
-
1348
-
There is currently no way to write an Error Boundary as a function component. However, you don't have to write the Error Boundary class yourself. For example, you can use [`react-error-boundary`](https://github.com/bvaughn/react-error-boundary) instead.
Profiling adds some additional overhead, so **it is disabled in the production build by default.** To opt into production profiling, you need to enable a [special production build with profiling enabled.](/reference/dev-tools/react-performance-tracks#using-profiling-builds)
- React will invalidate the cache for all memoized functions for each server request.
74
-
- Each call to `cache` creates a new function. This means that calling `cache` with the same function multiple times will return different memoized functions that do not share the same cache.
75
-
-`cachedFn` will also cache errors. If `fn` throws an error for certain arguments, it will be cached, and the same error is re-thrown when `cachedFn` is called with those same arguments.
76
-
-`cache` is for use in [Server Components](/reference/rsc/server-components) only.
77
-
>>>>>>> f9e2c1396769bb5da87db60f9ff03683d18711e2
78
69
79
70
---
80
71
@@ -212,27 +203,16 @@ async function MinimalWeatherCard({city}) {
212
203
213
204
<Note>
214
205
215
-
<<<<<<< HEAD
216
-
[//]: #'TODO: 合并后向服务器组件添加链接。'
217
-
218
206
<CodeStepstep={3}>异步渲染</CodeStep> 只在服务器组件中支持。
219
-
=======
220
-
<CodeStepstep={3}>Asynchronous rendering</CodeStep> is only supported for Server Components.
In this example, the Effect should re-run after a render when `url` changes (to log the new page visit), but it should **not** re-run when `numberOfItems` changes. By wrapping the logging logic in an Effect Event, `numberOfItems` becomes non-reactive. It's always read from the latest value without triggering the Effect.
97
94
98
95
You can pass reactive values like `url` as arguments to the Effect Event to keep them reactive while accessing the latest non-reactive values inside the event.
0 commit comments