diff --git a/examples/ReactNativeVanilla/storybook/stories/index.js b/examples/ReactNativeVanilla/storybook/stories/index.js new file mode 100644 index 000000000000..63f1a6266717 --- /dev/null +++ b/examples/ReactNativeVanilla/storybook/stories/index.js @@ -0,0 +1,25 @@ +import React from 'react'; +import { Text } from 'react-native'; + +import { storiesOf } from '@storybook/react-native'; +import { action } from '@storybook/addon-actions'; +import { linkTo } from '@storybook/addon-links'; + +import Button from './Button'; +import CenterView from './CenterView'; +import Welcome from './Welcome'; + +storiesOf('Welcome', module).add('to Storybook', () => ); + +storiesOf('Button', module) + .addDecorator(getStory => {getStory()}) + .add('with text', () => ( + + )) + .add('with some emoji', () => ( + + )); diff --git a/lib/cli/generators/REACT_NATIVE/template/storybook/index.js b/lib/cli/generators/REACT_NATIVE/template/storybook/index.android.js similarity index 100% rename from lib/cli/generators/REACT_NATIVE/template/storybook/index.js rename to lib/cli/generators/REACT_NATIVE/template/storybook/index.android.js diff --git a/lib/cli/generators/REACT_NATIVE/template/storybook/index.ios.js b/lib/cli/generators/REACT_NATIVE/template/storybook/index.ios.js new file mode 100644 index 000000000000..87262c017095 --- /dev/null +++ b/lib/cli/generators/REACT_NATIVE/template/storybook/index.ios.js @@ -0,0 +1,11 @@ +import { AppRegistry } from 'react-native'; +import { getStorybookUI, configure } from '@storybook/react-native'; + +// import stories +configure(() => { + require('./stories'); +}, module); + +const StorybookUI = getStorybookUI({ port: 7007, host: 'localhost' }); +AppRegistry.registerComponent('%APP_NAME%', () => StorybookUI); +export default StorybookUI;