mirror of
https://github.com/reactjs/react.dev.git
synced 2026-02-23 20:23:08 +00:00
Fix typos in lazy.md and cache.md (#7141)
This commit is contained in:
@@ -226,7 +226,7 @@ By caching a long-running data fetch, you can kick off asynchronous work prior t
|
||||
```jsx [[2, 6, "await getUser(id)"], [1, 17, "getUser(id)"]]
|
||||
const getUser = cache(async (id) => {
|
||||
return await db.user.query(id);
|
||||
})
|
||||
});
|
||||
|
||||
async function Profile({id}) {
|
||||
const user = await getUser(id);
|
||||
@@ -327,7 +327,7 @@ In general, you should use [`useMemo`](/reference/react/useMemo) for caching a e
|
||||
'use client';
|
||||
|
||||
function WeatherReport({record}) {
|
||||
const avgTemp = useMemo(() => calculateAvg(record)), record);
|
||||
const avgTemp = useMemo(() => calculateAvg(record), record);
|
||||
// ...
|
||||
}
|
||||
|
||||
|
||||
@@ -78,7 +78,7 @@ Now that your component's code loads on demand, you also need to specify what sh
|
||||
<Suspense fallback={<Loading />}>
|
||||
<h2>Preview</h2>
|
||||
<MarkdownPreview />
|
||||
</Suspense>
|
||||
</Suspense>
|
||||
```
|
||||
|
||||
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:
|
||||
|
||||
Reference in New Issue
Block a user