Unverified Commit f54dbb9c authored by Joseph's avatar Joseph Committed by GitHub

docs: fix unstable_cache syntax error (#96002)

The function signature was wrong:

```tsx
function Page({ params } }){
```

Which also prevented prettier from running in the code block. This PR
fixes the signature and formats the code block.
parent 18d2e2da
...@@ -72,20 +72,20 @@ export default async function Page({ ...@@ -72,20 +72,20 @@ export default async function Page({
``` ```
```jsx filename="app/page.jsx" switcher ```jsx filename="app/page.jsx" switcher
import { unstable_cache } from 'next/cache'; import { unstable_cache } from 'next/cache'
export default async function Page({ params } }) { export default async function Page({ params }) {
const { userId } = await params const { userId } = await params
const getCachedUser = unstable_cache( const getCachedUser = unstable_cache(
async () => { async () => {
return { id: userId }; return { id: userId }
}, },
[userId], // add the user ID to the cache key [userId], // add the user ID to the cache key
{ {
tags: ["users"], tags: ['users'],
revalidate: 60, revalidate: 60,
} }
); )
//... //...
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment