本页还没有译文
本页 8 段还没译成日本語,下面显示的是英文原文。mdx-components.js
还没翻译译自英文(nextjs.org)本页 8 段都还没译
The mdx-components.js|tsx file is required to use @next/mdx with App Router and will not work without it. Additionally, you can use it to customize styles.
Use the file mdx-components.tsx (or .js) in the root of your project to define MDX Components. For example, at the same level as pages or app, or inside src if applicable.
mdx-components.tsx
import type { MDXComponents } from 'mdx/types'
const components: MDXComponents = {}
export function useMDXComponents(): MDXComponents {
return components
}mdx-components.js
const components = {}
export function useMDXComponents() {
return components
}Exports
useMDXComponents function
The file must export a single function named useMDXComponents. This function does not accept any arguments.
mdx-components.tsx
import type { MDXComponents } from 'mdx/types'
const components: MDXComponents = {}
export function useMDXComponents(): MDXComponents {
return components
}mdx-components.js
const components = {}
export function useMDXComponents() {
return components
}Version History
| Version | Changes |
|---|---|
v13.1.2 | MDX Components added |
AI 翻译查看英文原文