Skip to content
This repository was archived by the owner on Jan 24, 2025. It is now read-only.

Commit a9384b0

Browse files
committed
fix(gatsby-theme-docz): fix theme components customization bug
1 parent c9a304f commit a9384b0

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

core/gatsby-theme-docz/src/base/Layout.js

+6-3
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import React, { Fragment } from 'react'
22
import PropTypes from 'prop-types'
33
import { useComponents } from 'docz'
44
import { propEq, get } from 'lodash/fp'
5+
import { MDXProvider } from '@mdx-js/react'
56

67
import { useDbQuery } from '../hooks/useDbQuery'
78
import Wrapper from '../wrapper'
@@ -17,9 +18,11 @@ const Route = ({ children, entry, isTransclusion, ...defaultProps }) => {
1718
return isTransclusion ? (
1819
children
1920
) : (
20-
<Wrapper>
21-
<Layout {...props}>{children}</Layout>
22-
</Wrapper>
21+
<MDXProvider components={components}>
22+
<Wrapper>
23+
<Layout {...props}>{children}</Layout>
24+
</Wrapper>
25+
</MDXProvider>
2326
)
2427
}
2528

core/gatsby-theme-docz/src/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import components from '~components'
99
const Theme = ({ children }) => {
1010
const config = useConfig()
1111
return (
12-
<ThemeProvider theme={config.themeConfig} components={components}>
12+
<ThemeProvider theme={config.themeConfig}>
1313
<ComponentsProvider components={components}>
1414
<Styled.root>{children}</Styled.root>
1515
</ComponentsProvider>

0 commit comments

Comments
 (0)