storybook-addon-options icon indicating copy to clipboard operation
storybook-addon-options copied to clipboard

Usage with React Native

Open inyono opened this issue 7 years ago • 0 comments

I'm failing to get this to work with React Native (and create-react-native-app). After following the README, I get the error null is not an object (evaluating 'channel.emit') @ setOptions.

storybook/addons.js

import '@kadira/react-native-storybook/addons';
import '@kadira/storybook-addon-options/register';

storybook/index.js

import './addons';

import { NativeModules } from 'react-native';
import { getStorybookUI, configure } from '@kadira/react-native-storybook';
import url from 'url';

import { setOptions } from '@kadira/storybook-addon-options';

setOptions({
    name: 'CUSTOM-OPTIONS',
    url: 'https://github.com/kadirahq/storybook-addon-options',
    goFullScreen: false,
    showLeftPanel: false,
    showDownPanel: false,
    showSearchBox: false,
    downPanelInRight: false,
    sortStoriesByKind: false,
});

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

const { hostname } = url.parse(NativeModules.SourceCode.scriptURL);

export default getStorybookUI({ port: 19001, host: hostname });

Any idea, what the problem might be?

inyono avatar Mar 28 '17 16:03 inyono