Skip to content

Reanimated warning: "Dependencies should only be used on the web" from useAnimatableValue #613

Description

@oikalyptus

Description

With Reanimated 4.7, every app that renders a Sortable.Grid logs this warning on native:

WARN  [Reanimated] Dependencies should only be used on the web and are always ignored on native. Check DevTools to see the offending code.

The stack points into the library: useAnimatableValue calls useDerivedValue with a dependency array (src/integrations/reanimated/hooks/useAnimatableValue.ts):

return useDerivedValue(() => {
  const inputValue = isSharedValue<V>(value) ? value.value : value;
  return modify ? modify(inputValue) : inputValue;
}, [value, modify]);

Reanimated's native useDerivedValue ignores the dependency array and warns once (useDerivedValue.native.ts, warnOnce). The warning appears on app start and in Jest. Nothing in user code passes dependencies.

Stack (Jest):

at useAnimatableValue (node_modules/react-native-sortables/src/integrations/reanimated/hooks/useAnimatableValue.ts:22:25)
at SortableGridInner (node_modules/react-native-sortables/src/components/SortableGrid.tsx:118:39)

Expected behavior

No warning from library code. Dropping the dependency array on native should not change behavior, since Reanimated ignores it there.

Environment

  • react-native-sortables: 1.10.0
  • react-native-reanimated: 4.7.0
  • react-native-worklets: 0.13.0
  • react-native: 0.88.0-rc.1
  • expo: 58.0.0-preview.7
  • Platform: iOS (also reproduces under Jest)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions