Conversation
frankieyan
approved these changes
Aug 5, 2021
Member
frankieyan
left a comment
There was a problem hiding this comment.
Using the Canvas instead of Preview seems to allow the right source code to be displayed in each example as well. Awesome!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Short description
During the upgrade to Storybook 6 and the shift to MDX stories, we noticed that the prop types for the
Modalstory weren't inferred due to its structure (a component with subcomponents with their own props and types as its type).After a lot of researching online and creating a discussion in Storybook's repo, we have yet to find a way to automatically infer prop types of this component. Two workarounds were: a) inferring prop types from one of the actual stories i.e. Playground and not the component or b) manually set these props and their descriptions (the former wouldn't handle this). In this PR, I've attempted option b.
Granted it may not be the best solution, as any changes made to the
Modalcomponent will mean inconsistent prop types between itself and the story. But I'm struggling to see how we can get these inferred without completely changing the structure of ourModalcomponent so that it's no longer a component made up of types.This PR can serve as a bit of an exploratory area if we're not happy with this approach. Feel free to suggest alternative ways to achieve this or even contribute to this branch.
PR Checklist