Skip to content

Commit

Permalink
fix: reorder call to params
Browse files Browse the repository at this point in the history
  • Loading branch information
blechatellier committed Oct 27, 2024
1 parent 6e473c4 commit cb9e087
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion examples/next-app/app/[locale]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,11 @@ import { Provider } from './provider';

// eslint-disable-next-line @typescript-eslint/no-unused-vars
export default async function Home({ params }: { params: Promise<{ locale: string }> }) {
const { locale } = await params;

// Uncomment to test Static Generation
// setStaticParamsLocale(locale);

const { locale } = await params;
const t = await getI18n();
const t2 = await getScopedI18n('scope.more');
const currentLocale = getCurrentLocale();
Expand Down
3 changes: 2 additions & 1 deletion examples/next-app/app/[locale]/subpage/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@ import { getI18n } from '../../../locales/server';

// eslint-disable-next-line @typescript-eslint/no-unused-vars
export default async function Subpage({ params }: { params: Promise<{ locale: string }> }) {
const { locale } = await params;

Check failure on line 11 in examples/next-app/app/[locale]/subpage/page.tsx

View workflow job for this annotation

GitHub Actions / lint

'locale' is assigned a value but never used

// Uncomment to test Static Generation
// const { locale } = await params;
// setStaticParamsLocale(locale);

const t = await getI18n();
Expand Down

0 comments on commit cb9e087

Please sign in to comment.