Skip to content

Commit

Permalink
fix(gatsby-plugin-mdx): mdxrender should not accept components (#24271)
Browse files Browse the repository at this point in the history
* Remove 'components' from MDXRenderer signature

Work for #21682

* Removed 'components' from MDXRenderer type

* removed components

* removed unneeded extra imports
  • Loading branch information
floAr committed Sep 9, 2020
1 parent 58dc15e commit 9c58e34
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
3 changes: 0 additions & 3 deletions packages/gatsby-plugin-mdx/index.d.ts
Expand Up @@ -2,9 +2,6 @@ import * as React from "react"

export interface MDXRendererProps {
scope?: any
components?: {
[key: string]: React.ComponentType<any>
}
children: string
[propName: string]: any
}
Expand Down
6 changes: 2 additions & 4 deletions packages/gatsby-plugin-mdx/mdx-renderer.js
@@ -1,14 +1,12 @@
const React = require(`react`)
const { useMDXComponents, mdx } = require(`@mdx-js/react`)
const { mdx } = require(`@mdx-js/react`)
const { useMDXScope } = require(`./context`)

module.exports = function MDXRenderer({
scope,
components,
children,
...props
}) {
const mdxComponents = useMDXComponents(components)
const mdxScope = useMDXScope(scope)

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

return React.createElement(End, { components: mdxComponents, ...props })
return React.createElement(End, {...props })
}

0 comments on commit 9c58e34

Please sign in to comment.