Storybook: Import withInfo in ReactNative gives Bundler error

Created on 5 Jul 2018  路  5Comments  路  Source: storybookjs/storybook

Basic import of withInfo Add On in ReactNative gives error Module './lib/nestedObjectAssign.js' was required dynamically. This is not supported by Metro bundler

Happens just by adding import { withInfo } from '@storybook/addon-info' import Button from './Button' couldn't get past this to even add a story using the add on.

Please specify which version of Storybook and optionally any affected addons that you're running

  • @storybook/react-native 3.4.8
  • @storybook/addon-info 3.4.8
info react-native question / support

Most helpful comment

Sure.

Addon support is documented here: https://github.com/storybooks/storybook/blob/master/ADDONS_SUPPORT.md

Regarding why it is not supported is that info addon a strange addon since it doesn't work inside addon (panel) area. It works by rendering info in preview area. React Native doesn't use preview area at all.

There are alternatives to get withInfo functionality for RN:

You will also need to update your babelrc to support docgen addon.

I know it is not the same, but currently it is the only way to achieve it.

All 5 comments

Same problem here.
"@storybook/addon-actions": "^4.0.0-alpha.14", "@storybook/addon-info": "^4.0.0-alpha.14", "@storybook/addon-links": "^4.0.0-alpha.14", "@storybook/addons": "^4.0.0-alpha.14", "@storybook/react-native": "^4.0.0-alpha.14",

Addon info is not supported in react native

Is it possible to get some information about why it isn't supported? I don't see this documented anywhere...

Sure.

Addon support is documented here: https://github.com/storybooks/storybook/blob/master/ADDONS_SUPPORT.md

Regarding why it is not supported is that info addon a strange addon since it doesn't work inside addon (panel) area. It works by rendering info in preview area. React Native doesn't use preview area at all.

There are alternatives to get withInfo functionality for RN:

You will also need to update your babelrc to support docgen addon.

I know it is not the same, but currently it is the only way to achieve it.

Thanks for detailed response. I like this one informative
Addon Support for each platform

Was this page helpful?
0 / 5 - 0 ratings

Related issues

shilman picture shilman  路  3Comments

xogeny picture xogeny  路  3Comments

purplecones picture purplecones  路  3Comments

wahengchang picture wahengchang  路  3Comments

sakulstra picture sakulstra  路  3Comments