How to use the @storybook/react-native.getStorybookUI function in @storybook/react-native

To help you get started, we’ve selected a few @storybook/react-native examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github syl20lego / rn-skeleton / storybook / index.js View on Github external
/* eslint-disable global-require */
import React, { Component } from 'react';
import { AppRegistry } from 'react-native';
import { getStorybookUI, configure } from '@storybook/react-native';

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

// This assumes that storybook is running on the same host as your RN packager,
// to set manually use, e.g. host: 'localhost' option
const StorybookUIRoot = getStorybookUI({ port: 7007, onDeviceUI: true });

// react-native hot module loader must take in a Class - https://github.com/facebook/react-native/issues/10991
// https://github.com/storybooks/storybook/issues/2081
// eslint-disable-next-line react/prefer-stateless-function
class StorybookUIHMRRoot extends Component {
    render() {
        return ;
    }
}

AppRegistry.registerComponent('RNskeleton', () => StorybookUIHMRRoot);
export default StorybookUIHMRRoot;
github storybookjs / storybook / lib / cli / generators / REACT_NATIVE / template / storybook / storybook.js View on Github external
/* eslint-disable global-require */

import { AppRegistry } from 'react-native';
import { getStorybookUI, configure } from '@storybook/react-native';

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

// This assumes that storybook is running on the same host as your RN packager,
// to set manually use, e.g. host: 'localhost' option
const StorybookUI = getStorybookUI({ port: 7007, onDeviceUI: true });
AppRegistry.registerComponent('%APP_NAME%', () => StorybookUI);
export default StorybookUI;
github digidem / mapeo-mobile / storybook-native / index.js View on Github external
import { AppRegistry } from "react-native";
import { getStorybookUI, configure } from "@storybook/react-native";

import { name as appName } from "../app.json";

import "./rn-addons";

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

// Refer to https://github.com/storybooks/storybook/tree/master/app/react-native#start-command-parameters
// 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 can safely remove this line.
AppRegistry.registerComponent(appName, () => StorybookUIRoot);

export default StorybookUIRoot;
github RocketChat / Rocket.Chat.ReactNative / storybook / index.js View on Github external
import { AppRegistry } from 'react-native';
import { getStorybookUI, configure } from '@storybook/react-native'; // eslint-disable-line

import RNBootSplash from 'react-native-bootsplash';
import 'react-native-gesture-handler';

RNBootSplash.hide();

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

// Refer to https://github.com/storybooks/storybook/tree/master/app/react-native#start-command-parameters
// 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 can safely remove this line.
AppRegistry.registerComponent('RocketChatRN', () => StorybookUIRoot);

export default StorybookUIRoot;
github Guppster / KrackAttack / App / storybook / storybook.js View on Github external
import { AppRegistry } from 'react-native'
import { getStorybookUI, configure } from '@storybook/react-native'

// import stories
configure(() => {
  require('../App/Components/Stories')
}, module)

// This assumes that storybook is running on the same host as your RN packager,
// to set manually use, e.g. host: 'localhost' option
const StorybookUI = getStorybookUI({ port: 7007, onDeviceUI: true })
AppRegistry.registerComponent('KRACK', () => StorybookUI)
export default StorybookUI
github GSS-FED / vital-ui-kit-react / packages / native / storybook / storybook.js View on Github external
/* eslint-disable global-require */
import React, { Component } from 'react';
import { AppRegistry } from 'react-native';
import { getStorybookUI, configure } from '@storybook/react-native';

import { ThemeProvider } from '../src';

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

// This assumes that storybook is running on the same host as your RN packager,
// to set manually use, e.g. host: 'localhost' option
const StorybookUIRoot = getStorybookUI({
  port: 7007,
  onDeviceUI: true,
});

// react-native hot module loader must take in a Class - https://github.com/facebook/react-native/issues/10991
// https://github.com/storybooks/storybook/issues/2081
// eslint-disable-next-line react/prefer-stateless-function
class StorybookUIHMRRoot extends Component {
  render() {
    return (
      
        
      
    );
  }
}
github dooboolab / dooboo-ui-native / storybook / index.js View on Github external
addDecorator,
  configure,
  getStorybookUI,
} from '@storybook/react-native';

import { AppRegistry } from 'react-native';
import { withKnobs } from '@storybook/addon-knobs';

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

// Refer to https://github.com/storybookjs/storybook/tree/master/app/react-native#start-command-parameters
// To find allowed options for getStorybookUI
const StorybookUIRoot = getStorybookUI({ port: 7007, host: 'localhost' });

// 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 can safely remove this line.
AppRegistry.registerComponent('%APP_NAME%', () => StorybookUIRoot);

addDecorator(withKnobs);

export default StorybookUIRoot;
github alexakasanjeev / magento_react_native / storybook / index.js View on Github external
/* eslint-disable import/no-extraneous-dependencies */
import { getStorybookUI, configure } from '@storybook/react-native';
import { loadStories } from './storyLoader';

import './addons';
import './rn-addons';

// import stories
configure(() => {
  loadStories();
}, module);

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

export default StorybookUIRoot;
github wix / wix-react-native-storybook-template / get-storybook.js View on Github external
export function getStorybook(resolveFunction, moduleName, options) {
  configureStoriesWithDecorators(resolveFunction, moduleName);
  return getStorybookUI({...options, asyncStorage: require('@react-native-community/async-storage').default});
}
github infinitered / ChainReactApp2019 / storybook / storybook.ts View on Github external
import { configure, getStorybookUI } from "@storybook/react-native"

configure(() => {
  require("./storybook-registry")
})

export const StorybookUI = getStorybookUI({ port: 9001, host: "localhost", onDeviceUI: true })