Created
November 15, 2021 00:13
-
-
Save trooperandz/2c7f3ee8d64bb3eb1d233c27cbceb4d4 to your computer and use it in GitHub Desktop.
React Native Storybook story loader index file
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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