-
-
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
Addon-docs: Fix React.forwardedRef/memo props #8445
Addon-docs: Fix React.forwardedRef/memo props #8445
Conversation
This pull request is being automatically deployed with ZEIT Now (learn more). 🔍 Inspect: https://zeit.co/storybook/monorepo/pude9nc6y |
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.
Thank you @darmawanalbert -- this is really awesome!!
This code makes sense, but since it's React-specific, would it be possible to put it inside the getPropDefs
function returned from inferPropDefs
?
Also, if it's a similar fix, would you mind also adding React.memo
support and test case while you're at it?
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.
Meant to request changes in my prev review :)
@shilman sure, let me try it on |
@shilman I have added another logic to fix |
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.
This is freakin' awesome @darmawanalbert! Thanks so much for the fix!!!
Addon-docs: Fix React.forwardedRef/memo props
Issue: #7933
What I did
Fix Props block rendering issue when using
React.forwardRef
by checking whether the target should be callingrender()
first to get the list ofpropTypes
or not.How to test