-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
More detailed props table #1485
More detailed props table #1485
Conversation
Codecov Report
@@ Coverage Diff @@
## release/3.3 #1485 +/- ##
===============================================
- Coverage 23.05% 22.65% -0.41%
===============================================
Files 248 264 +16
Lines 5703 5906 +203
Branches 673 690 +17
===============================================
+ Hits 1315 1338 +23
- Misses 3901 4069 +168
- Partials 487 499 +12
Continue to review full report at Codecov.
|
@billyvg awesome--thanks so much for putting this together? Is there any chance you can add this to the To get the example running on your machine:
Many thanks again and please let me know if you have any questions! |
Added the @billyvg Please ask us anything if you need help! Thank you for this PR! |
@billyvg Are you still working on this? |
related: #1147 |
I am! I'm having trouble deciding how to design nested arrayOf/shape types. I have another branch that flattens the props like
Any suggestions? |
Good to hear, looking forward to this PR completing! 🎈 Here's an out of the box suggestion: https://github.com/xyc/react-inspector Otherwise I'm liking the original screen quite a lot actually! |
* more details for arrayOf, objectOf, shape, oneOf, oneOfType * refactored into cleaner code + many smaller components
0119c23
to
7ce5673
Compare
@ndelangen Cleaned up the code a bunch as well as improve the formatting: https://cl.ly/151I0X3Q0O34/Screen%20Recording%202017-08-23%20at%2003.40%20PM.gif |
@billyvg That looks fantastic! I rebased this to release 3.3 branch. I hope this doesn't influence you in a bad way. |
import React from 'react'; | ||
import glamorous from 'glamorous'; | ||
|
||
const Button = props => <span role="button" tabIndex={-1} {...props} />; |
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.
Why span
not button
?
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.
I did not want to have to reset/restyle a button
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.
Native buttons have some advantages like automatically triggering click event on Enter
. I believe it’s worth a bit of extra styling
import { TypeInfo } from './proptypes'; | ||
|
||
const ObjectOf = ({ propType }) => | ||
<span> |
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.
✅
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.
Please use native buttons
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.
LGTM
@billyvg Is this still a WIP? If not, remove the |
@ndelangen I think it's no longer a WIP, I've removed the tag. |
Congrats on your first merged PR @billyvg ! 🎉 I hope more will follow! |
Issue:
PropTypes for
shape
,oneOf
, andarrayOf
could be more specific. There's lots of useful data missing for these types. Since this is a WIP, there's probably some better work to be done for other prop types as well.Ex:
What I did
Changed PropTable to be more detailed by inspecting
__docgenInfo
and recursively formatting certain prop types.How to test
Open a component in storybook that has these proptypes:
oneOf
,shape
,arrayOf