-
-
Notifications
You must be signed in to change notification settings - Fork 9.2k
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 inline stories using react hooks #7946
Conversation
This pull request is automatically deployed with Now. |
cc @Aaron-Pool can you take a quick look? |
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.
Thanks @atanasster! Good catch and great fix!
@shilman as to if this will have any effect on inlining other frameworks--shouldn't be a problem. I can just set storyFn directly to the result of As for most everything else in this PR, my knowledge of React hooks and React rendering is pretty limited, so... LGTM? 🤷♂️ |
@Aaron-Pool - my vue.js is like your react :) Can you help me - how do you test the vue.js integration, I can try to run some tests on my end. |
@atanasster this almost certainly won't break any current Vue functionality. 5.2 only supports iframe-based stories for non-react frameworks (e.g. Vue), so changes to inline rendering shouldn't effect the Vue side of things yet. Shilman tagged me (I assume) because of a PR I'm doing for 5.3 to add inline rendering support for Vue, as well as a path to inline support for other frameworks. But yes, like you said, story preview is already pretty tightly bound to react magic, so these changes shouldn't impede my project. Might have to make a few tiny tweaks, but it should be fine! 👍 |
You guys are awesome. 💯 Merging this! Recategorizing as a bug since we're in RC mode and only merging bugfixes. We're claiming React hooks support in 5.2, so I think it's appropriate. |
Issue: #7924
What I did
Replaced the storyFn instead of direct call, to be rendered as a react element
How to test
added reactHook story to Stories.stories.tsx and can be tested in official-storybook