Skip to content

Commit

Permalink
Fix typos in lazy.md and cache.md (#7141)
Browse files Browse the repository at this point in the history
  • Loading branch information
kihyeoon committed Sep 2, 2024
1 parent c2d6131 commit 391dadb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/content/reference/react/cache.md
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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);
// ...
}

Expand Down
2 changes: 1 addition & 1 deletion src/content/reference/react/lazy.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 391dadb

Please sign in to comment.