diff --git a/lib/cli/src/generators/REACT_NATIVE/template-csf/storybook/index.js b/lib/cli/src/generators/REACT_NATIVE/template-csf/storybook/index.js index 3f532f977435..f6a30232e53b 100644 --- a/lib/cli/src/generators/REACT_NATIVE/template-csf/storybook/index.js +++ b/lib/cli/src/generators/REACT_NATIVE/template-csf/storybook/index.js @@ -1,8 +1,14 @@ +// if you use expo remove this line import { AppRegistry } from 'react-native'; -import { getStorybookUI, configure } from '@storybook/react-native'; + +import { getStorybookUI, configure, addDecorator } from '@storybook/react-native'; +import { withKnobs } from '@storybook/addon-knobs'; import './rn-addons'; +// enables knobs for all stories +addDecorator(withKnobs); + // import stories configure(() => { require('./stories'); @@ -13,7 +19,7 @@ configure(() => { 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. +// If you use Expo you should remove this line. AppRegistry.registerComponent('%APP_NAME%', () => StorybookUIRoot); export default StorybookUIRoot;