Skip to content

Commit cdfcf43

Browse files
committed
Import storybook
1 parent e4e34a0 commit cdfcf43

File tree

2 files changed

+22
-2
lines changed

2 files changed

+22
-2
lines changed

index.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { AppRegistry } from 'react-native';
2-
import App from './src/App';
2+
33
import { name as appName } from './app.json';
4+
import StorybookUIRoot from './stories/storybook';
45

5-
AppRegistry.registerComponent(appName, () => App);
6+
AppRegistry.registerComponent(appName, () => StorybookUIRoot);

stories/storybook.js

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import { AppRegistry } from 'react-native';
2+
import { getStorybookUI, configure } from '@storybook/react-native';
3+
4+
import { name as appName } from './../app.json';
5+
6+
// import stories
7+
configure(() => {
8+
require('./components/Avatar/avatar.icons.stories');
9+
}, module);
10+
11+
// Refer to https://github.com/storybooks/storybook/tree/master/app/react-native#start-command-parameters
12+
// To find allowed options for getStorybookUI
13+
const StorybookUIRoot = getStorybookUI({});
14+
15+
// If you are using React Native vanilla and after installation you don't see your app name here, write it manually.
16+
// If you use Expo you can safely remove this line.
17+
AppRegistry.registerComponent(appName, () => StorybookUIRoot);
18+
19+
export default StorybookUIRoot;

0 commit comments

Comments
 (0)