Files
next.js/examples/mdx/mdx-components.tsx
Remco HaszingGitHubgraphite-app[bot] <96075541+graphite-app[bot]@users.noreply.github.com>JosephJoseph
42bcacd9a1 Remove useMDXComponents argument (#80871)
### What?

Fix the signatures of `useMDXComponents`.

### Why?

The `useMDXComponents` function is always called without any arguments.
It’s also always supposed to be a named export, not a default export.
It’s also called during render. Defining React components during render
is an anti-pattern. All components that were previously defined inside
of `useMDXComponents`, are now defined outside of the function.

### How?

Manual fixes.

---------

Co-authored-by: graphite-app[bot] <96075541+graphite-app[bot]@users.noreply.github.com>
Co-authored-by: Joseph <[email protected]>
Co-authored-by: Joseph <[email protected]>
2025-07-29 22:45:08 +02:00

9 lines
227 B
TypeScript

import type { MDXComponents } from "mdx/types";
const components: MDXComponents = {};
// Allows customizing built-in components, e.g. to add styling.
export function useMDXComponents(): MDXComponents {
return components;
}