-
-
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
Codemod: Handle react hooks better for CSF3 #21115
Codemod: Handle react hooks better for CSF3 #21115
Comments
Just curious, why not add an alias? That seems to be one thing that people try to do when writing their own stories too, not just when converting from csf2 to csf3. |
@shilman I think it'd probably make sense to alias |
I just ran into this, and decided to disable the lint rule in I agree the codemod should handle it better, but I'm probably going to run in to this again coding by hand.
|
What's the point of wrapping stories that only have a single FC into an object with a function that isn't a react component? Feels like storybook syntax is wrong here. |
@mctrafik Storybook still supports older versions of CSF for precisely this reason, and will continue to support them in the foreseeable future. |
^ Why support multiple syntaxes that work for different use cases, instead of supporting a single syntax that works for all use cases? |
Is your feature request related to a problem? Please describe
Currently, the CSF 2-to-3 codemod would turn the following story:
Into:
This triggers a rules of hooks eslint error:
Describe the solution you'd like
Detect likely hooks (
useX
) and transform into:Describe alternatives you've considered
Support
Render
alias:Are you able to assist to bring the feature to reality?
no
Additional context
No response
The text was updated successfully, but these errors were encountered: