Skip to content

Commit

Permalink
Merge pull request #25908 from storybookjs/dannyhw/fix-rn-init-existi…
Browse files Browse the repository at this point in the history
…ng-package

React Native: Fix init fails when package is already installed

(cherry picked from commit 985505a)
  • Loading branch information
yannbf authored and storybook-bot committed Feb 6, 2024
1 parent d6c2610 commit 0626b7f
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions code/lib/cli/src/generators/REACT_NATIVE/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,15 @@ const generator = async (

const reactVersion = packageJson.dependencies.react;

const packagesToResolve = [
// addon-ondevice-controls peer deps
const controlsPeerDependencies = [
'react-native-safe-area-context',
'@react-native-async-storage/async-storage',
'@react-native-community/datetimepicker',
'@react-native-community/slider',
].filter((dep) => !packageJson.dependencies[dep] && !packageJson.devDependencies[dep]);

const packagesToResolve = [
...controlsPeerDependencies,
'@storybook/addon-ondevice-controls',
'@storybook/addon-ondevice-actions',
'@storybook/react-native',
Expand Down

0 comments on commit 0626b7f

Please sign in to comment.