Skip to content

Commit 9c58e34

Browse files
authored
fix(gatsby-plugin-mdx): mdxrender should not accept components (#24271)
* Remove 'components' from MDXRenderer signature Work for #21682 * Removed 'components' from MDXRenderer type * removed components * removed unneeded extra imports
1 parent 58dc15e commit 9c58e34

File tree

2 files changed

+2
-7
lines changed

2 files changed

+2
-7
lines changed

packages/gatsby-plugin-mdx/index.d.ts

-3
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,6 @@ import * as React from "react"
22

33
export interface MDXRendererProps {
44
scope?: any
5-
components?: {
6-
[key: string]: React.ComponentType<any>
7-
}
85
children: string
96
[propName: string]: any
107
}

packages/gatsby-plugin-mdx/mdx-renderer.js

+2-4
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
11
const React = require(`react`)
2-
const { useMDXComponents, mdx } = require(`@mdx-js/react`)
2+
const { mdx } = require(`@mdx-js/react`)
33
const { useMDXScope } = require(`./context`)
44

55
module.exports = function MDXRenderer({
66
scope,
7-
components,
87
children,
98
...props
109
}) {
11-
const mdxComponents = useMDXComponents(components)
1210
const mdxScope = useMDXScope(scope)
1311

1412
// Memoize the compiled component
@@ -32,5 +30,5 @@ module.exports = function MDXRenderer({
3230
return fn({}, ...values)
3331
}, [children, scope])
3432

35-
return React.createElement(End, { components: mdxComponents, ...props })
33+
return React.createElement(End, {...props })
3634
}

0 commit comments

Comments
 (0)