Skip to content

docs: Add blog post about rootParams #1632

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 16 commits into
base: main
Choose a base branch
from
Draft
Prev Previous commit
Next Next commit
highlight
  • Loading branch information
amannn committed Feb 19, 2025
commit bb47cbb79751cdd174cdb7d985eeb05daa7b9af9
7 changes: 5 additions & 2 deletions docs/src/pages/blog/nextjs-root-params.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ Similarly to how we've defined the `getLocale` function above, we do in fact alr

So let's use `rootParams` here:

```tsx filename="src/i18n/request.ts"
```tsx filename="src/i18n/request.ts" {7}
import {unstable_rootParams as rootParams} from 'next/server';
import {getRequestConfig} from 'next-intl/server';
import {hasLocale} from 'next-intl';
Expand Down Expand Up @@ -275,7 +275,10 @@ export default getRequestConfig(async ({locale}) => {
: routing.defaultLocale;
}

// ...
return {
locale
// ...
};
});
```

Expand Down
Loading