Reputation: 4671
Hi i want to run storybook
in a react-native package, that i have created with create-react-native-library
.
So, the steps i ve done, in order to havethe package up and running are:
npx create-react-native-library@latest react-native-awesome-module
// create a simple packageexamples
folder, run yarn start
so it loads on the iPhone
simulator.npx -p @storybook/cli sb init --type react
The yarn storybook
command gives error like so: Error: Cannot find module 'react-dom/package.json'
I attach a screenshot for reference:
So, is there a way to integrate the storybook into this package ? Do i miss anything ? thanks
Upvotes: 0
Views: 479
Reputation: 6359
According to the Storybook for React Native | Documentation,
You have to specify the --type
as react_native
not react
.
npx -p @storybook/cli sb init --type react_native
Upvotes: 1
Reputation: 886
To use storybook with react native you have to change --type
to react_native
.
This means, that your command to initialize storybook will be:
npx -p @storybook/cli sb init --type react_native
Upvotes: 1