@storybook/addon-ondevice-controls (deprecated)
Controls are built into @storybook/react-native from v11 and are on by default. You don't need this package.
This package is now an empty compatibility stub. Its register registers nothing, so configs that still list it in deviceAddons keep working and get the built-in Controls panel, plus a one-time warning in development asking you to remove it. It no longer depends on @react-native-community/datetimepicker, @react-native-community/slider or react-native-modal-datetime-picker.
Migrating
-
Remove it from
deviceAddonsin.rnstorybook/main.ts:const main: StorybookConfig = { deviceAddons: [ - '@storybook/addon-ondevice-controls', '@storybook/addon-ondevice-notes', ], }; -
Uninstall it:
npm uninstall @storybook/addon-ondevice-controls -
Restart your bundler so
storybook.requires.tsis regenerated (or runnpx sb-rn-get-stories).
@react-native-community/datetimepicker and @react-native-community/slider are now optional. Keep them if you want the native date picker and slider; without them the Controls panel uses JavaScript fallbacks. If nothing else in your app uses react-native-modal-datetime-picker, you can uninstall that too.
To turn the built-in Controls panel off, set features: { ondeviceControls: false } in main.ts.
If you imported getControlArgTypes or hasEnabledControl from @storybook/addon-ondevice-controls/dist/controlArgTypes, import it from @storybook/react-native/controls instead.
See the Controls guide and the migration guide.
- ndelangen
- shilman
- tmeasday
- winkervsbecks
- kylegach
- jreinhold