Skip to content

fix: keep addon panels mounted when inactive#857

Merged
dannyhw merged 2 commits intonextfrom
dannyhw/fix/addons-panel-inactive
Feb 28, 2026
Merged

fix: keep addon panels mounted when inactive#857
dannyhw merged 2 commits intonextfrom
dannyhw/fix/addons-panel-inactive

Conversation

@dannyhw
Copy link
Member

@dannyhw dannyhw commented Feb 28, 2026

Summary

  • All addon panels are now always rendered and hidden with display: none when inactive, instead of returning null and unmounting
  • Applies to both react-native-ui and react-native-ui-lite MobileAddonsPanel implementations
  • Removes early !active return guards from BackgroundPanel, controls Panel, and Notes

Problem

Previously, switching addon tabs would unmount the inactive panel and lose its state. This meant:

  • Actions logged while viewing another tab were lost
  • Panels had to re-initialize every time they became active
  • Any in-progress state (e.g. control edits) was discarded on tab switch

Test plan

  • Run the expo example, trigger some actions, then switch to the controls tab and back — actions should still be there
  • Switch between all addon tabs — no crashes or blank panels
  • Verify backgrounds, controls, and notes panels all render correctly when selected
  • Test on both full UI and lite UI modes

Previously inactive panels returned null, which unmounted them and
lost their state. Now all panels are always rendered and inactive
ones are hidden with display:none. This ensures panels like actions
stay updated even when not visible.
@changeset-bot
Copy link

changeset-bot bot commented Feb 28, 2026

🦋 Changeset detected

Latest commit: 32fb3d6

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 9 packages
Name Type
@storybook/addon-ondevice-backgrounds Patch
@storybook/react-native-ui-lite Patch
@storybook/addon-ondevice-controls Patch
@storybook/react-native-ui Patch
@storybook/addon-ondevice-notes Patch
@storybook/react-native Patch
@storybook/react-native-ui-common Patch
@storybook/react-native-theming Patch
@storybook/addon-ondevice-actions Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@dannyhw dannyhw merged commit 32b4cee into next Feb 28, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant