amannn / next-intl

🌐 Internationalization (i18n) for Next.js
https://next-intl-docs.vercel.app
MIT License
2.58k stars 236 forks source link

docs: update with-i18n-routing.mdx with nextjs 15 `params` change #1401

Closed ammubhave closed 1 month ago

ammubhave commented 1 month ago

Update app router with-i18n-routing with a nextjs 15 params change. In nextjs 15, the params property is a promise. Although direct access is still supported, it is deprecated.

If params is accessed directly, and not awaited then we get the following warning

In route /[locale] a param property was accessed directly with `params.locale`. `params` is now a Promise and should be awaited before accessing properties of the underlying params object. In this version of Next.js direct access to param properties is still supported to facilitate migration but in a future version you will be required to await `params`. If this use is inside an async function await it. If this use is inside a synchronous function then convert the function to async or await it from outside this function and pass the result in.

For more information see https://github.com/vercel/next.js/pull/68812

vercel[bot] commented 1 month ago

@ammubhave is attempting to deploy a commit to the next-intl Team on Vercel.

A member of the Team first needs to authorize it.

vercel[bot] commented 1 month ago

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

Name Status Preview Comments Updated (UTC)
next-intl-example-app-router ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 4, 2024 4:04pm
next-intl-example-app-router-without-i18n-routing ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 4, 2024 4:04pm
amannn commented 1 month ago

Thanks for the proposed update! There will be a few more updates necessary to the docs, but let's wait for now until the stable release of Next.js 15 lands. I'll close this as a duplicate of https://github.com/amannn/next-intl/pull/1089.