Skip to content

Commit

Permalink
docs : fix typo in React cache example (#52787)
Browse files Browse the repository at this point in the history
### Description
This PR fix typo in the description of Caching Data

### Changes
- Added types to React `cache()` exercise

File: `docs/02-app/01-building-your-application/03-data-fetching/02-caching.mdx`
  • Loading branch information
Ryan-Dia committed Jul 17, 2023
1 parent 503677c commit 82efdfe
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,11 @@ export const getUser = cache(async (id) => {
```tsx filename="app/user/[id]/layout.tsx" switcher
import { getUser } from '@utils/getUser'

export default async function UserLayout({ params: { id } }) {
export default async function UserLayout({
params: { id },
}: {
params: { id: string }
}) {
const user = await getUser(id)
// ...
}
Expand Down

0 comments on commit 82efdfe

Please sign in to comment.