Skip to content

Instantly share code, notes, and snippets.

@trooperandz
Created November 15, 2021 00:13
Show Gist options
  • Save trooperandz/2c7f3ee8d64bb3eb1d233c27cbceb4d4 to your computer and use it in GitHub Desktop.
Save trooperandz/2c7f3ee8d64bb3eb1d233c27cbceb4d4 to your computer and use it in GitHub Desktop.
React Native Storybook story loader index file
import { AppRegistry } from 'react-native';
import {
getStorybookUI,
configure,
addDecorator,
} from '@storybook/react-native';
import { withKnobs } from '@storybook/addon-knobs';
import { loadStories } from './storyLoader';
import './rn-addons';
// Enables knobs for all stories
addDecorator(withKnobs);
// Import stories
configure(() => {
loadStories();
}, module);
const StorybookUIRoot = getStorybookUI({
asyncStorage: null,
});
AppRegistry.registerComponent('StorybookReactNative', () => StorybookUIRoot);
export default StorybookUIRoot;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment