Repository navigation
fix(ui): stop passing useAnimatedStyle dependencies on native - #948
Merged
Merged
Conversation
🦋 Changeset detectedLatest commit: 8761de7 The changes in this PR will be included in the next version bump. This PR includes changesets to release 9 packages
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
force-pushed
the
dannyhw/fix/reanimated-deps-warning
branch
from
October 24, 2026 13:54
134ee9b to
590b304
Compare
dannyhw
force-pushed
the
dannyhw/fix/reanimated-deps-warning
branch
2 times, most recently
from
November 8, 2026 21:18
4956cc0 to
2345904
Compare
dannyhw
force-pushed
the
dannyhw/fix/reanimated-deps-warning
branch
from
November 8, 2026 21:25
2345904 to
0a89bdf
Compare
Reanimated 4.6+ ignores the dependency array on native, where the
worklets plugin already captures the closure, and warns about it
("Dependencies should only be used on the web"). The array is kept on
web, where it is still used when the worklets babel plugin does not run:
without it a production web build would compute maxHeight only once and
clip the panel on a narrow viewport.
Adds a regression test that renders MobileAddonsPanel and asserts
useAnimatedStyle receives no dependency array on native and the
dependencies on web.
Fixes #943
dannyhw
force-pushed
the
dannyhw/fix/reanimated-deps-warning
branch
from
November 12, 2026 20:05
0a89bdf to
8761de7
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue: #943
Stacked on #947, because it reuses that PR's jest setup for
@storybook/react-native-ui. It will retarget tonextonce #947 merges. Only the top commit belongs to this PR.What I did
MobileAddonsPanelpassed a dependency array touseAnimatedStyle. On native, Reanimated 4.6+ ignores it (the worklets plugin captures the closure) and logs[Reanimated] Dependencies should only be used on the web and are always ignored on nativeon every Storybook launch.The array is now passed only on web:
Platform.OS === 'web' ? [...] : undefined.undefined, which Reanimated 3.x and 4.x treat exactly like an omitted argument: the dependencies come from the worklet closure instead.react-native-reanimated >=3peer range.The other Reanimated warnings in such a launch come from
@gorhom/bottom-sheet's own hooks, so this PR doesn't touch them.How to test
pnpm -F @storybook/react-native-ui test: the new tests assertuseAnimatedStylegetsundefinedon iOS and Android and the array on web. Onnextthe native cases fail withReceived: [{"value": 0}, 844, 34]. Manually: launch Storybook withreact-native-reanimated≥ 4.6 and check that the warning no longer comes fromMobileAddonsPanel.Fixes #943