-
-
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
noRefCheck functions on the Show Code #17701
Comments
I'm just facing the same issue. Seems like @Smankusors has already found out how to fix this...? 🙏 |
PR: #19004 |
Facing the same issue 👀 |
Any news on this issue? It would be awesome if we can gave good code export functionality. Thank you! |
any update I'm facing the same issue |
Hi @viniisdsc Did you try the latest version of storybook? And what does your |
We also have this issue. Running version |
Please try the prerelease version: v7.0.0-alpha.46 |
Still seeing this in 7.0.18. |
Ditto, We're still seeing this in |
We see this in |
I'm also suffering from this in In everyone's screenshots, |
Describe the bug
I found something weird when reading the code generated on Storybook, that is every function that I didn't define, shows up as noRefCheck. Even though if I set it manually as undefined.
But no, that's just a background, and I believe that issue might have to do with the
react-element-to-jsx-string
. The actual issue, is that the first function is always written as() => {}
while the rest functions would be written asfunction noRefCheck() {}
. Now that's pretty weird behaviour IMO. Please take a look at this built-in example (?) belowNow... isn't that code should be like this below?
it looks more pretty.
To Reproduce
I don't think I need to create a repo for this. I just simply:
npx create-react-app
npx sb init
npm run storybook
System
Additional context
I think I found the culprit, just replace the
replace
withreplaceAll
. If you allow, I can create a PR to fix this including adding a new unit test to cover this one. wdyt?The text was updated successfully, but these errors were encountered: