Want to give something stronger than just a "thumbs up" for this.
I tried v6 RC.4 yesterday and the snippet rendering for our project was broken or otherwise inadequate for all but the simplest of story sources (using the "CSF stories with arbitrary MDX" recipe). For some, it even hit callstack limits and broke the page entirely. Basically, we hit many of the issues captured here (https://github.com/storybookjs/addon-jsx/issues) and here (https://github.com/algolia/react-element-to-jsx-string/issues), specifically the displayName problem with the newer React features and, not necessarily a bug, but the snippets aren't nearly as useful for documentation if they only display the returned JSX and not the entire source.
Happy to try to produce simplified test case(s), if that would be helpful, though I suspect I should mostly direct that feedback at the upstream library.
Thanks! And other than this, V6 was looking and feeling _great_!
@kylegach thanks for the feedback. i knew this was a rats nest when I started us down this path, but we'll get it sorted out. opting out will be a good escape valve for people who were satisfied with the v5 behavior.
Good golly!! I just released https://github.com/storybookjs/storybook/releases/tag/v6.0.0-rc.10 containing PR #11601 that references this issue. Upgrade today to try it out!
You can find this prerelease on the @next NPM tag.
Closing this issue. Please re-open if you think there's still more to do.
So I updated to rc.11 and now stories that used to have code-snippets generated for them are just showing "No Code Available"
export const Test = () => {
const foo = "foobar"
return (
<div>
{ foo }
</div>
)
}
results in this:

Back in v5.0.0 this would have given us the source instead
@TomWija do you have a repro I can look at?
Here's one I put together that replicates the problem
https://github.com/TomWija/storybook-source-test
Thanks @TomWija, I'll try to get out a fix in the next RC 馃檲
隆Ay Caramba!! I just released https://github.com/storybookjs/storybook/releases/tag/v6.0.0-rc.14 containing PR #11650 that references this issue. Upgrade today to try it out!
You can find this prerelease on the @next NPM tag.
FYI, all of my issues are resolved as of RC15! 馃帀 I don't even have to use this opt out. 馃檭
@kylegach great news! will be tweaking this more before release -- hopefully I don't break anything for you 馃檲
Most helpful comment
Thanks @TomWija, I'll try to get out a fix in the next RC 馃檲