Skip to content

Commit

Permalink
fix(gatsby-theme-docz): fix theme components customization bug
Browse files Browse the repository at this point in the history
  • Loading branch information
rakannimer committed Apr 5, 2020
1 parent c9a304f commit a9384b0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
9 changes: 6 additions & 3 deletions core/gatsby-theme-docz/src/base/Layout.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import React, { Fragment } from 'react'
import PropTypes from 'prop-types'
import { useComponents } from 'docz'
import { propEq, get } from 'lodash/fp'
import { MDXProvider } from '@mdx-js/react'

import { useDbQuery } from '../hooks/useDbQuery'
import Wrapper from '../wrapper'
Expand All @@ -17,9 +18,11 @@ const Route = ({ children, entry, isTransclusion, ...defaultProps }) => {
return isTransclusion ? (
children
) : (
<Wrapper>
<Layout {...props}>{children}</Layout>
</Wrapper>
<MDXProvider components={components}>
<Wrapper>
<Layout {...props}>{children}</Layout>
</Wrapper>
</MDXProvider>
)
}

Expand Down
2 changes: 1 addition & 1 deletion core/gatsby-theme-docz/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import components from '~components'
const Theme = ({ children }) => {
const config = useConfig()
return (
<ThemeProvider theme={config.themeConfig} components={components}>
<ThemeProvider theme={config.themeConfig}>
<ComponentsProvider components={components}>
<Styled.root>{children}</Styled.root>
</ComponentsProvider>
Expand Down

0 comments on commit a9384b0

Please sign in to comment.