Replies: 1 comment 1 reply
-
|
Please create a fresh reproduction
|
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
ScopedTheme partial updates with StyleSheet.create
Environment
react-native-unistyles/pluginwithroot: 'src'anddebug: trueIssue
When changing
ScopedThemename prop dynamically, only some StyleSheet.create styles update. Babel plugin detects all styles correctly, but nested components don't update. This test was done in Storybook. Same result in the app itself.Test Component
Babel Plugin Debug Output
✅ All styles detected correctly by Babel plugin
Observed Behavior
When changing theme via Storybook Controls (changes
ThemeWrapperprops):styles.containerupdates correctlystyles.contentupdates correctlystyles.subtitleupdates correctlystyles.sampleBoxdoes NOT update (stays same color, should change between themes)Steps Taken
npm start -- --reset-cache)sampleBox- no changeQuestion
Why do some StyleSheet.create styles update when ScopedTheme name changes, but others don't? The Babel plugin detects all theme dependencies correctly. Is this:
Expected: All components with
[Theme]dependency should update when ScopedTheme name changes.Actual: Only some components update, inconsistently.
UPDATED:
Tested in actual app - not Storybook-specific
Disabled React Compiler - not Issue #368
Beta Was this translation helpful? Give feedback.
All reactions