Skip to content

Commit

Permalink
docs: Improve static rendering docs
Browse files Browse the repository at this point in the history
  • Loading branch information
amannn authored Oct 28, 2024
1 parent 94245b2 commit 6512ddf
Showing 1 changed file with 1 addition and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,7 @@ export default function IndexPage({params: {locale}}) {

1. The locale that you pass to `setRequestLocale` should be validated (e.g. in your [root layout](#layout)).
2. You need to call this function in every page and every layout that you intend to enable static rendering for since Next.js can render layouts and pages independently.
3. `setRequestLocale` needs to be called before you invoke any functions from `next-intl` like `useTranslations` or `getMessages`.

<Details id="setrequestlocale-implementation">
<summary>How does setRequestLocale work?</summary>
Expand Down

0 comments on commit 6512ddf

Please sign in to comment.