v0.3.2 — Fix styles disappearing after undo
Bug fix
Pressing ↶ undo (or ↷ redo, or ↺ cancel) could wipe the style list in the inspector panel, leaving an empty view until you re-tapped the component.
Root cause
The inspector held the currently selected component's styles in local React state, populated optimistically on every edit. When a server-side file revert happened (undo/redo/cancel), the local array was never refreshed from the live fiber. Additionally, the persistence re-selection path created a placeholder node with styles: [], which could replace a live selection on Fast Refresh.
Fix
- New
src/utils/extractStyles.tswith a reusableextractStylesFromFiber()helper StudioProvidergains arefreshSelectioncallback scheduled on a 350 ms delay after undo/redo/cancel to let Metro Fast Refresh commit first- Persistence restore now populates styles from the fiber instead of the empty placeholder
Install
npm install rn-studio@0.3.2