-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Divider: Complete TypeScript migration of component #41991
Conversation
Size Change: 0 B Total Size: 1.25 MB ℹ️ View Unchanged
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code changes LGTM 🚀
The only aspect that I don't really like is that, in Storybook, the margin
, marginStart
and marginEnd
props are shown with a type of SpaceInput
, which isn't quite clean to the end user — although this behavior is already present on trunk
and, more generally, it is a known limitation of Storybook's docgen.
Maybe we could add more details to the prop descriptions? (related to #41882)
Yes. I can add a more detailed description. |
It definitely improves the user experience when browsing Storybook, but at the same time it means that change to the original TypeScript type won't be reflected automatically in Storybook — @mirka, do you have a preference on which compromise feels better? Maybe we could just make the JSDoc comment more detailed, e.g. by adding "This prop accepts both numbers and strings. When using numbers, they will be interpreted as multiples of the space grid used across the library; when using strings, they should be valid values for the CSS WDYT ? |
Agreed. I proposed #42376 to address this issue more broadly 👍 @walbo I think we can merge this PR without the change in b227e8e, and we'll take care of it in #42376. |
What?
Completes the migration of
Divider
component to TypeScript.Why?
Part of the @wordpress/components's TypeScript migration (#35744).
How?
Testing Instructions
Divider
continues to function as expected