Skip to content
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

docs: Adapt examples for rootParams #1619

Open
wants to merge 9 commits into
base: feat/support-rootparams
Choose a base branch
from

Conversation

amannn
Copy link
Owner

@amannn amannn commented Dec 18, 2024

Based on #1625

TODO

Copy link

vercel bot commented Dec 18, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
next-intl-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 19, 2024 11:19am
next-intl-example-app-router ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 19, 2024 11:19am
next-intl-example-app-router-without-i18n-routing ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 19, 2024 11:19am

@@ -12,7 +12,7 @@
},
"dependencies": {
"clsx": "^2.1.1",
"next": "^14.2.4",
"next": "15.1.1-canary.12",
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO: Revert once in stable

};

export default async function BaseLayout({children, locale}: Props) {
// Inline?
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO: Depends on whether a global not found page can be styled

it('renders', () => {
// Disabled until canary version is reverted
// eslint-disable-next-line jest/no-disabled-tests
it.skip('renders', () => {
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO: Should be resolved once we use the same version across packages and examples

export default getRequestConfig(async () => {
const params = await rootParams();
const locale = hasLocale(routing.locales, params.locale)
? params.locale
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@@ -7,7 +7,7 @@ import type {Locale} from './AppConfig.tsx';
*/
export default function hasLocale<LocaleType extends Locale>(
locales: ReadonlyArray<LocaleType>,
candidate?: string | null
candidate: unknown
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A param can be string[]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant