vercel / next.js

The React Framework
https://nextjs.org
MIT License
122.59k stars 26.23k forks source link

Fix the mdx-components examples #67188

Open remcohaszing opened 3 days ago

remcohaszing commented 3 days ago

This is a duplicate of #64769, which was closed and locked based on false claims. Please see the comments there for context.

I opened this new PR as requested by @karlhorky.

karlhorky commented 3 days ago

@samcx Another MDX PR opened by Remco, one of the core contributors to MDX - would you be able to take a look?

cc @delbaoliveira @manovotny (original PR reviewers)

karlhorky commented 1 day ago

@manovotny I confirmed just now that the first argument components of useMDXComponents receives undefined - so this parameter can probably indeed be removed (unless I'm missing something):

mdx-components.tsx

export function useMDXComponents(components: MDXComponents): MDXComponents {
  console.log('components', components);
  return {
    ...components,

Output:

 ✓ Compiled in 208ms (490 modules)
components undefined