-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Component Props not rendering on V2 #1079
Comments
Hey @jsplopes Could you provide an example component that's failing and the mdx file that's importing it ? It will help us reproduce your problem and hopefully fix it. |
Hey @rakannimer I made some debug and the issue is the same as i mentioned previously on bug #825 when get the filename |
Ok, thanks for reporting this. @fi3ework's fix here : fi3ework@69c9cf9 Could you check which version of Unfortunately I can't debug more as I don't have a Windows machine. Also, could you try running :
And let me know if it works as expected ? |
Hi @rakannimer, npx create-docz-app tmp-docz-test && cd tmp-docz-test && yarn dev the issue remains :(. The version of babel-plugin-export-metadata is 2.0.0-rc.1 |
having the same issue on Mac with [email protected] and [email protected] |
Hey @dreyks, Are you also using Windows ? |
nope. MacOS |
I'm not sure I have the same issue though. It's just Props is not working for me. I'll try to debug this today |
Oh sorry missed that in your previous comment ! Do these commands also fail ? Development : npx create-docz-app tmp-docz-test && cd tmp-docz-test && yarn dev Building : npx create-docz-app tmp-docz-test && cd tmp-docz-test && yarn docz build && yarn docz serve |
Ok, if you can, make sure to provide the component where |
btw
gives me
|
Could you try again now ? You might have an older version of |
ok i figured this (the original issue) out. I have my components wrapped inside React.forwardRef, so obviously docz can't find its props the |
fi3ework@69c9cf9 did fix the babel-plugin but there still seems to be something fishy in the |
@jsplopes Could you try with the latest rc |
I'm also having the same issue. As in my case, the component is actually wrapped in a factory method, not sure if this is the reason why it cannot be rendered. So here is the code just in case any of you could shed some light on this. Here is the factory method const createBox = (config: RenderComponentHookConfig<HTMLElement, BoxProps>) => {
const {
displayName = 'Box',
className = 'ui-box',
shorthandPropName = 'children',
defaultProps,
handledProps = [],
/* eslint-disable react/forbid-foreign-prop-types */
propTypes = {
...commonPropTypes.createCommon(),
},
contextMap = {},
render
} = config
const Box: CustomComponentType<HTMLElement, BoxProps> =
React.forwardRef((props: BoxProps, ref: React.Ref<HTMLElement>) => {
// code to create the box below
)
}) as CustomComponentType<HTMLElement, BoxProps>
Box.propTypes = propTypes
Box.defaultProps = defaultProps
return Box
} And here is the code to call the factory method to create the box component const config = {
displayName: 'Container',
className: 'ui-container',
props: {},
propTypes: {
...commonPropTypes.createCommon(),
fluid: PropTypes.bool
},
defaultProps: {
fluid: false
},
contextMap: []
} as RenderComponentHookConfig<HTMLElement, BoxProps>
const Container = createBox(config) as CustomComponentType<HTMLElement, ContainerProps> |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Alguém pode ajudar? C:>npx create-docz-app docz-teste Creating a new Docz app in C:\Users\mateus.sales\Documents\folder\docz-teste. Downloading files for example basic. This might take a moment. Aborting installation. |
Bug Report
The bug #825 reported on previous version is now appening on version 2.0.0-rc.28.
Regards,
Júlio
The text was updated successfully, but these errors were encountered: