We need to initialize the Storybook on our project. We'll use automatic setup with a few edits:
npx -p @storybook/cli sb init --type react_native
yarn add -D react-native-storybook-loader
On device addons
On device addons are addons that are displayed in your app in addons panel. To use them you have to create a file called rn-addons.js in storybook directory. Because React Native does not dynamically resolve imports, you will also have to manually import this file before the getStorybookUI call.
Step 9: Adding Storybook
We need to initialize the Storybook on our project. We'll use automatic setup with a few edits:
npx -p @storybook/cli sb init --type react_native
yarn add -D react-native-storybook-loader
On device addons
On device addons are addons that are displayed in your app in addons panel. To use them you have to create a file called rn-addons.js in storybook directory. Because React Native does not dynamically resolve imports, you will also have to manually import this file before the getStorybookUI call.
yarn add @storybook/addon-ondevice-knobs
yarn add @storybook/addon-ondevice-notes
Custom an entry file for Storybook.
Finally:
yarn storybook