You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a MDX file that renders the Props for a component from a file with two components. The default value for one of its props has the value from the defaultProps of the last component. If I change the order of them, it changes the default value being rendered.
BTW, I'm using the typescript-preset.
To Reproduce
Steps to reproduce the behavior:
Create a tsx files with two named export components and configure a prop with default value for each of them. That prop must have the same name for both of them but different accepted values.
Create a mdx story.
Import one or both (it doesn't matter) components and render their props.
Change the order of the components (in the tsx file).
See how the default value changes to the value of the last component.
Expected behavior
To respect the default value for each component.
Screenshots
Code snippets
exportinterfaceElemAProps{size?: 'a'|'b'|'c'|'d';}exportconstElemA: React.SFC<ElemAProps>=({ size ='a', children })=>(<divclassName={size}>{children}</div>);exportinterfaceElemBProps{size?: 'sm'|'md'|'lg';}exportconstParagraph: React.SFC<ElemBProps>=props=>(<divclassName={props.size}>{props.children}</div>);ElemBProps.defaultProps={size: 'md'};
Hi everyone! Seems like there hasn't been much going on in this issue lately. If there are still questions, comments, or bugs, please feel free to continue the discussion. Unfortunately, we don't have time to get to every issue. We are always open to contributions so please send us a pull request if you would like to help. Inactive issues will be closed after 30 days. Thanks!
Describe the bug
I have a MDX file that renders the
Props
for a component from a file with two components. The default value for one of its props has the value from thedefaultProps
of the last component. If I change the order of them, it changes the default value being rendered.BTW, I'm using the
typescript-preset
.To Reproduce
Steps to reproduce the behavior:
Expected behavior
To respect the default value for each component.
Screenshots
Code snippets
System:
The text was updated successfully, but these errors were encountered: