Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

StackOverflow Point

StackOverflow Point Navigation

  • Web Stories
  • Badges
  • Tags
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Web Stories
  • Badges
  • Tags
Home/ Questions/Q 4187
In Process
Alex Hales
  • 0
Alex HalesTeacher
Asked: June 3, 20222022-06-03T14:22:54+00:00 2022-06-03T14:22:54+00:00

reactjs – Sorybook integration with Expo React Native not working

  • 0

[ad_1]

I am trying to get Storybook running on a react native app build by Expo. I generated my project with:

expo init storybook-test

I entered the folder and ran:

npx -p @storybook/cli sb init --type react_native

…which I got from this tutorial and it added multiple files and folders such as:

- Root
- - storybook
- - - stories
- - - addons.js
- - - index.js
- - - rn-addons.js

It then told me to:

add the following to your entrypoint (usually App.js or index.js).

export {default} from "./storybook";

I wasn’t sure what that means as storybook>index.js already has a default export:

export default StorybookUIRoot;

I then edited my root/storybook/index.js as there is no main.js in my project to the following:

// if you use expo remove this line
// import { AppRegistry } from 'react-native';

import { getStorybookUI, configure, addDecorator } from '@storybook/react-native';
// import { withKnobs } from '@storybook/addon-knobs';

import './rn-addons';

// enables knobs for all stories
// addDecorator(withKnobs);

// import stories
configure(() => {
  require('./stories');
}, module);

// Refer to https://github.com/storybookjs/react-native/tree/master/app/react-native#getstorybookui-options
// To find allowed options for getStorybookUI
const StorybookUIRoot = getStorybookUI({});

// If you are using React Native vanilla and after installation you don't see your app name here, write it manually.
// If you use Expo you should remove this line.
// AppRegistry.registerComponent('%APP_NAME%', () => StorybookUIRoot);

export default StorybookUIRoot;

After all this, I ran yarn storybook and it opened the webpage but the stories never load.

What am I doing wrong?!

[ad_2]

  • 2 2 Answers
  • 2 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report
Leave an answer

Leave an answer
Cancel reply

Browse

2 Answers

  • Voted
  • Oldest
  • Recent
  • Random
  1. kompresör bursa
    2023-04-09T22:18:25+00:00Added an answer on April 9, 2023 at 10:18 pm

    Hemen Bilgi Alın. Yüksek Kalite ve Ekonomik Kompresör. İndirimi Kaçırmayın.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report
  2. arena plus nba playoff schedule philippines
    2023-05-11T13:41:24+00:00Added an answer on May 11, 2023 at 1:41 pm

    I love this app! A pleasant and enjoyable game tߋ play when you want tօ relax.

    Beautiful graphics, soothing music ɑnd not toօ loudly calls ⲟf numbers.
    The choice tⲟ play wіth games pieces, or to playing “free” іѕ
    great аnd no matter һow yoս play, yoᥙ coupd bе rewarded wіth multiple sports betting numƄers in уour playing cards.
    Ӏ reϲently һad tԝo cards I played during the
    exact same match. both of thеm weге winners of
    quadruple sports betting.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Related Questions

  • xcode - Can you build dynamic libraries for iOS and ...

    • 0 Answers
  • bash - How to check if a process id (PID) ...

    • 8087 Answers
  • database - Oracle: Changing VARCHAR2 column to CLOB

    • 1871 Answers
  • What's the difference between HEAD, working tree and index, in ...

    • 1957 Answers
  • Amazon EC2 Free tier - how many instances can I ...

    • 0 Answers

Stats

  • Questions : 43k

Subscribe

Login

Forgot Password?

Footer

Follow

© 2022 Stackoverflow Point. All Rights Reserved.

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.