storybookjs / storybook

Storybook is the industry standard workshop for building, documenting, and testing UI components in isolation
https://storybook.js.org
MIT License
84.68k stars 9.32k forks source link

[Bug]: SIlent failure in react native when using jsx in a file without importing react at the top #29205

Closed danieloi closed 2 weeks ago

danieloi commented 1 month ago

Describe the bug

Newer react versions don't require explicitly importing react at the top of files and many starters follow this new pattrn.

In react native however, you get a blank screen with no error message in the console whatsoever.

Reproduction link

https://github.com/danieloi/storybook-silent-error-repro/tree/main

Reproduction steps

Use these components in an expo react native app and notice how you get a blank screen unless you import react at the top of the file

System

System:
    OS: macOS 14.5
    CPU: (10) arm64 Apple M1 Pro
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 20.15.1 - ~/.nvm/versions/node/v20.15.1/bin/node
    Yarn: 3.4.1 - ~/.yarn/bin/yarn
    npm: 10.7.0 - ~/.nvm/versions/node/v20.15.1/bin/npm <----- active
  Browsers:
    Chrome: 129.0.6668.60
    Safari: 17.5

Additional context

No response

shilman commented 1 month ago

How do I run your reproduction?

github-actions[bot] commented 3 weeks ago

Hi there! Thank you for opening this issue, but it has been marked as stale because we need more information to move forward. Could you please provide us with the requested reproduction or additional information that could help us better understand the problem? We'd love to resolve this issue, but we can't do it without your help!

github-actions[bot] commented 2 weeks ago

I'm afraid we need to close this issue for now, since we can't take any action without the requested reproduction or additional information. But please don't hesitate to open a new issue if the problem persists – we're always happy to help. Thanks so much for your understanding.