diff --git a/packages/gatsby-plugin-mdx/context.js b/packages/gatsby-plugin-mdx/context.js index d87532b94fa8e..2a9728e9dc368 100644 --- a/packages/gatsby-plugin-mdx/context.js +++ b/packages/gatsby-plugin-mdx/context.js @@ -7,8 +7,9 @@ export const useMDXScope = scope => { return scope || contextScope } -export const MDXScopeProvider = ({ __mdxScope, children }) => ( - - {children} - -) +export const MDXScopeProvider = ({ __mdxScope, children }) => + React.createElement( + GatsbyMDXScopeContext.Provider, + { value: __mdxScope }, + children + )