Removing the addons from the config makes extract succeed.
Current workaround
Customers must manually remove all on-device addons from .rnstorybook/main.ts.
Proposed fix
Introduce a new deviceAddons property in the StorybookConfig type for @storybook/react-native. On-device addons listed there will not be evaluated as presets by Storybook Core, but will still be injected by scripts/generate.js into the generated storybook.requires.ts at runtime.
const main: StorybookConfig = {
framework: '@storybook/react-native',
stories: ['../stories/**/*.stories.?(ts|tsx|js|jsx)'],
deviceAddons: [
'@storybook/addon-ondevice-controls',
'@storybook/addon-ondevice-actions',
],
};
Implementation tasks
Removing the addons from the config makes extract succeed.
Current workaround
Customers must manually remove all on-device addons from
.rnstorybook/main.ts.Proposed fix
Introduce a new
deviceAddonsproperty in theStorybookConfigtype for@storybook/react-native. On-device addons listed there will not be evaluated as presets by Storybook Core, but will still be injected byscripts/generate.jsinto the generatedstorybook.requires.tsat runtime.Implementation tasks
deviceAddonstoStorybookConfigtype in@storybook/react-nativescripts/generate.jsto read from bothmain.addonsandmain.deviceAddonsfor register & preview injection intostorybook.requires.ts(this is the only file that consumes on-device addons)ondevicein its name fromaddonstodeviceAddonsstorybook initfor RN to place on-device packages indeviceAddons