Skip to content

Commit ba067df

Browse files
committed
docs: Improve phrasing for MDX docs
1 parent b2117e1 commit ba067df

File tree

1 file changed

+11
-3
lines changed
  • docs/pages/docs/environments

1 file changed

+11
-3
lines changed

docs/pages/docs/environments/mdx.mdx

+11-3
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,15 @@ src
2121
Now, in `page.tsx`, you can import the MDX content based on the user's locale:
2222

2323
```tsx filename="src/app/[locale]/page.tsx"
24+
import {notFound} from 'next/navigation';
25+
2426
export default async function HomePage({params}) {
25-
const Content = (await import(`./${params.locale}.mdx`)).default;
26-
return <Content />;
27+
try {
28+
const Content = (await import(`./${params.locale}.mdx`)).default;
29+
return <Content />;
30+
} catch (error) {
31+
notFound();
32+
}
2733
}
2834
```
2935

@@ -44,7 +50,9 @@ Components that invoke hooks from `next-intl` like `useTranslations` can natural
4450
<Details id="rich-text">
4551
<summary>Is MDX required to format rich text?</summary>
4652

47-
Not at all! Messages support [rich text syntax](/docs/usage/messages#rich-text), which can be used to provide formatting, structure and embedding of components.
53+
Not at all! The built in message formatting of `next-intl` supports [rich text syntax](/docs/usage/messages#rich-text), which can be used to provide formatting, and to embed React components within messages.
54+
55+
MDX is best suited for cases where content varies significantly by locale. If all you're looking for is rich text formatting, the built-in message formatting may be an easier choice.
4856

4957
</Details>
5058

0 commit comments

Comments
 (0)