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
Copy file name to clipboardexpand all lines: src/content/reference/react/lazy.md
+1-1
Original file line number
Diff line number
Diff line change
@@ -78,7 +78,7 @@ Now that your component's code loads on demand, you also need to specify what sh
78
78
<Suspense fallback={<Loading />}>
79
79
<h2>Preview</h2>
80
80
<MarkdownPreview />
81
-
</Suspense>
81
+
</Suspense>
82
82
```
83
83
84
84
In this example, the code for `MarkdownPreview` won't be loaded until you attempt to render it. If `MarkdownPreview` hasn't loaded yet, `Loading` will be shown in its place. Try ticking the checkbox:
Copy file name to clipboardexpand all lines: src/content/reference/react/useSyncExternalStore.md
+1-1
Original file line number
Diff line number
Diff line change
@@ -41,7 +41,7 @@ It returns the snapshot of the data in the store. You need to pass two functions
41
41
42
42
#### Parameters {/*parameters*/}
43
43
44
-
* `subscribe`: A function that takes a single `callback` argument and subscribes it to the store. When the store changes, it should invoke the provided `callback`. This will cause the component to re-render. The `subscribe` function should return a function that cleans up the subscription.
44
+
* `subscribe`: A function that takes a single `callback` argument and subscribes it to the store. When the store changes, it should invoke the provided `callback`, which will cause React to re-call `getSnapshot` and (if needed) re-render the component. The `subscribe` function should return a function that cleans up the subscription.
45
45
46
46
* `getSnapshot`: A function that returns a snapshot of the data in the store that's needed by the component. While the store has not changed, repeated calls to `getSnapshot` must return the same value. If the store changes and the returned value is different (as compared by [`Object.is`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is)), React re-renders the component.
0 commit comments