Describe the bug
I have a basic React + styled-components setup. Everything is working great until I use the withTheme HOC from styled-components. If I use any HOC's in my components the <PropsTable> no longer renders... Is there a solution to this?
To Reproduce
Docz versions:
docz v0.13.7
docz-theme-default v0.13.7
(I also tried with 0.14.0-alpha.68 on both but still doesn't work..
This is my component file Test.js
import React from 'react'
import PropTypes from 'prop-types'
import styled, { withTheme } from 'styled-components'
const Test = ({ name }) => (
<Name>{name}</Name>
)
const Name = styled.div`
display: inline-flex;
padding: 15px 20px;
margin: 10px;
border-radius: 5px;
background-color: yellowgreen;
justify-content: center;
align-items: center;
color: white;
`
Test.propTypes = {
name: PropTypes.string
}
Test.defaultProps = {
name: 'John Deere'
}
export default withTheme(Test)
and my Test.mdx file
name: Test
menu: Components
---
import { Playground, PropsTable } from 'docz'
import Test from './'
# Test
<PropsTable of={Test} />
## Basic Usage
<Playground>
<Test />
<Test name="Jackson" />
</Playground>
Expected behavior
The props table should render like below:
(this only renders when I export the component without the HOC: export default Test)

Any kind of fix with using HOC's would be helpful...
There is a bug with the same issue with forwardRef : https://github.com/pedronauck/docz/issues/334#issuecomment-457510992
You have to use Test component to use <PropsTable>.
Test and withTheme(Test). WithTheme(Test) would be the default export.import Test, {Test as TestWithPropTypes} from './'
<Playground><Test /></Playground>
<PropsTable of={TestWithPropTypes} />
Test with render.type() :<PropsTable of={Test.render().type} />
This is a huge problem when wrapping components in React.memo.
Most helpful comment
This is a huge problem when wrapping components in
React.memo.