File tree Expand file tree Collapse file tree 11 files changed +19
-19
lines changed
Expand file tree Collapse file tree 11 files changed +19
-19
lines changed Original file line number Diff line number Diff line change @@ -128,7 +128,7 @@ Then set `transformer.unstable_allowRequireContext` to true
128128
129129``` js
130130const { getDefaultConfig } = require (' expo/metro-config' );
131- const withStorybook = require (' @storybook/react-native/metro/withStorybook' );
131+ const { withStorybook } = require (' @storybook/react-native/metro/withStorybook' );
132132
133133const defaultConfig = getDefaultConfig (__dirname );
134134
@@ -139,7 +139,7 @@ module.exports = withStorybook(defaultConfig);
139139
140140``` js
141141const { getDefaultConfig } = require (' @react-native/metro-config' );
142- const withStorybook = require (' @storybook/react-native/metro/withStorybook' );
142+ const { withStorybook } = require (' @storybook/react-native/metro/withStorybook' );
143143
144144const defaultConfig = getDefaultConfig (__dirname );
145145
Original file line number Diff line number Diff line change @@ -171,7 +171,7 @@ npx expo@latest customize metro.config.js
171171copy the metro config
172172
173173``` js
174- const withStorybook = require (' @storybook/react-native/metro/withStorybook' );
174+ const { withStorybook } = require (' @storybook/react-native/metro/withStorybook' );
175175module .exports = withStorybook (config);
176176```
177177
@@ -386,7 +386,7 @@ Then navigate to `/storybook` in your app to view stories.
386386``` js
387387// metro.config.js
388388const { getDefaultConfig } = require (' expo/metro-config' );
389- const withStorybook = require (' @storybook/react-native/metro/withStorybook' );
389+ const { withStorybook } = require (' @storybook/react-native/metro/withStorybook' );
390390
391391const defaultConfig = getDefaultConfig (__dirname );
392392
@@ -409,7 +409,7 @@ This is useful for conditionally including Storybook in development but excludin
409409``` js
410410// metro.config.js
411411const { getDefaultConfig } = require (' expo/metro-config' );
412- const withStorybook = require (' @storybook/react-native/metro/withStorybook' );
412+ const { withStorybook } = require (' @storybook/react-native/metro/withStorybook' );
413413
414414const defaultConfig = getDefaultConfig (__dirname );
415415
Original file line number Diff line number Diff line change @@ -155,7 +155,7 @@ The `withStorybook` Metro wrapper automatically runs story generation:
155155
156156``` js
157157// metro.config.js
158- const withStorybook = require (' @storybook/react-native/metro/withStorybook' );
158+ const { withStorybook } = require (' @storybook/react-native/metro/withStorybook' );
159159
160160module .exports = withStorybook (config, {
161161 configPath: ' ./.rnstorybook' , // Must match CLI --config-path
Original file line number Diff line number Diff line change @@ -190,7 +190,7 @@ Wrap your Metro config with the `withStorybook` function:
190190
191191``` js
192192const { getDefaultConfig } = require (' expo/metro-config' );
193- const withStorybook = require (' @storybook/react-native/metro/withStorybook' );
193+ const { withStorybook } = require (' @storybook/react-native/metro/withStorybook' );
194194
195195const config = getDefaultConfig (__dirname );
196196module .exports = withStorybook (config);
Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ The `withStorybook` function is a Metro configuration wrapper that enables Story
1010
1111``` js
1212const { getDefaultConfig } = require (' expo/metro-config' );
13- const withStorybook = require (' @storybook/react-native/metro/withStorybook' );
13+ const { withStorybook } = require (' @storybook/react-native/metro/withStorybook' );
1414
1515const config = getDefaultConfig (__dirname );
1616
Original file line number Diff line number Diff line change @@ -34,7 +34,7 @@ const StorybookUIRoot = view.getStorybookUI({
3434
3535``` js
3636// metro.config.js
37- const withStorybook = require (' @storybook/react-native/metro/withStorybook' );
37+ const { withStorybook } = require (' @storybook/react-native/metro/withStorybook' );
3838
3939module .exports = withStorybook (config, {
4040 websockets: {
Original file line number Diff line number Diff line change @@ -28,7 +28,7 @@ Then update your `metro.config.js` file to include the Storybook wrapper:
2828
2929``` js
3030const { getDefaultConfig } = require (' expo/metro-config' );
31- const withStorybook = require (' @storybook/react-native/metro/withStorybook' );
31+ const { withStorybook } = require (' @storybook/react-native/metro/withStorybook' );
3232
3333/** @type {import('expo/metro-config').MetroConfig} */
3434const config = getDefaultConfig (__dirname );
Original file line number Diff line number Diff line change @@ -36,7 +36,7 @@ If you have other config wrapper functions like `withNativeWind` you will want t
3636``` js
3737// metro.config.js
3838const { getDefaultConfig } = require (' expo/metro-config' );
39- const withStorybook = require (' @storybook/react-native/metro/withStorybook' ); // <-- add this
39+ const { withStorybook } = require (' @storybook/react-native/metro/withStorybook' ); // <-- add this
4040
4141/** @type {import('expo/metro-config').MetroConfig} */
4242const config = getDefaultConfig (__dirname );
Original file line number Diff line number Diff line change @@ -93,7 +93,7 @@ Update `metro.config.js`:
9393
9494``` js
9595const { getDefaultConfig } = require (' expo/metro-config' );
96- const withStorybook = require (' @storybook/react-native/metro/withStorybook' );
96+ const { withStorybook } = require (' @storybook/react-native/metro/withStorybook' );
9797
9898const defaultConfig = getDefaultConfig (__dirname );
9999
@@ -104,7 +104,7 @@ For React Native CLI projects:
104104
105105``` js
106106const { getDefaultConfig , mergeConfig } = require (' @react-native/metro-config' );
107- const withStorybook = require (' @storybook/react-native/metro/withStorybook' );
107+ const { withStorybook } = require (' @storybook/react-native/metro/withStorybook' );
108108
109109const defaultConfig = getDefaultConfig (__dirname );
110110
Original file line number Diff line number Diff line change @@ -171,7 +171,7 @@ npx expo@latest customize metro.config.js
171171copy the metro config
172172
173173``` js
174- const withStorybook = require (' @storybook/react-native/metro/withStorybook' );
174+ const { withStorybook } = require (' @storybook/react-native/metro/withStorybook' );
175175module .exports = withStorybook (config);
176176```
177177
@@ -386,7 +386,7 @@ Then navigate to `/storybook` in your app to view stories.
386386``` js
387387// metro.config.js
388388const { getDefaultConfig } = require (' expo/metro-config' );
389- const withStorybook = require (' @storybook/react-native/metro/withStorybook' );
389+ const { withStorybook } = require (' @storybook/react-native/metro/withStorybook' );
390390
391391const defaultConfig = getDefaultConfig (__dirname );
392392
@@ -409,7 +409,7 @@ This is useful for conditionally including Storybook in development but excludin
409409``` js
410410// metro.config.js
411411const { getDefaultConfig } = require (' expo/metro-config' );
412- const withStorybook = require (' @storybook/react-native/metro/withStorybook' );
412+ const { withStorybook } = require (' @storybook/react-native/metro/withStorybook' );
413413
414414const defaultConfig = getDefaultConfig (__dirname );
415415
You can’t perform that action at this time.
0 commit comments