Henrique Silva
Henrique Silva

Reputation: 23

Panel, addons and components not showing in Storybook with react-native

i'm setting up Storybook in React Native project, but the right side panel that show preview components is not showing nothing, in some video tutorias that's I see, it's not happen. how i can resolve this? some more configuration is needed?

see more here: https://i.sstatic.net/ev9N4.png

Upvotes: 1

Views: 4248

Answers (2)

Ajit Singh
Ajit Singh

Reputation: 128

In Storybook React native components does not appear in preview on storybook webpage. Instead when you select a component story for preview on webpage, preview of the respective component story appears on the mobile simulator. This is the expected behaviour.

Upvotes: 5

Marko Prcać
Marko Prcać

Reputation: 580

I believe that the case show in your image (component preview visible on the device, but not in the web browser) is the normal behavior based on the Issue below:

Similar question was posted in the storybook github repo here. Issue is titled Stories not displaying in the web browser- react-native #3353.

Answer by storybook team member @igor-dv:

React native stories can't be shown in the browser with an out-of-the-box use case - because they are react-native. As you can see in the first Welcome to storybook screen or in the Readme, you should perform more steps to see them on the device.

Furthermore only suggestion by same team member for enabling components on web is:

If you do want to see them in the browser, you may set up the react-native-web. But you should understand that it won't be real native stories.

Also I don't beleive that this use case will be supported anytime soon, as another team member, @danielduan wrote:

I personally think the web UI is of little value to most developers. We should just default to device UI only

P.S. All the similar issues can be found under issue #7723 here. This being intended behavior is additionally confirmed by third team member @Gongreg:

This is not a bug but intended behaviour, there is no content to show in the web (it is React Native app that you are playing around, not the web).

Upvotes: 0

Related Questions