software-mansion / react-native-reanimated

React Native's Animated library reimplemented
https://docs.swmansion.com/react-native-reanimated/
MIT License
8.98k stars 1.3k forks source link

interpolateNode is not a function #1677

Closed DeniferSantiago closed 3 years ago

DeniferSantiago commented 3 years ago

Description

I just updated reanimated to version 2.0.0-rc.2, following the steps in the documentation then I have read the migration guide in which it tells me that I should change my imports from interpolate to interpolateNode and I have done so, but unfortunately I get the following error:

Screenshots

WhatsApp Image 2021-01-29 at 6 20 45 PM

Steps To Reproduce

These are the steps I have taken:

  1. Update reanimated: npm i react-native-reanimated@next
  2. Add babel plugin: react-native-reanimated/plugin in babel.config.js
  3. Turn on Hermes engine, setting: enableHermes: true in android/app/build.gradle
  4. modify the MainAplication.java file as the documentation indicates
  5. Clean gradle proyect: cd android; ./gradlew clean
  6. Run the project for android

Also I have tried to clear cache and everything like that as indicated here.

Package versions

github-actions[bot] commented 3 years ago

Issue validator

The issue is invalid!

jakub-gonet commented 3 years ago

Have you tried using yarn? There were similar reports in the past and sometimes using yarn helped.

L-Yeiser commented 3 years ago

In react-native-reanimated 2.2.0 Animated.interpolate is no longer a function. To quote the docs:

When using interpolate imported directly from react-native-reanimated v1, in v2 you should use interpolateNode instead. If you were using a class member method AnimatedValue.interpolate, no change is necessary.
chandniKkpl commented 1 year ago

I am using react native version 0.66.4 and Reanimated version 1.8.0 and I am getting this error The error message "TypeError: (0, _reactNativeReanimated.useAnimatedRef) is not a function" typically occurs in React Native when there is an issue with importing or using the useAnimatedRef function from react-native-reanimated

divonelnc commented 1 year ago

In react-native-reanimated 2.2.0 Animated.interpolate is no longer a function. To quote the docs:

When using interpolate imported directly from react-native-reanimated v1, in v2 you should use interpolateNode instead. If you were using a class member method AnimatedValue.interpolate, no change is necessary.

The issue is not with interpolate, but with interpolateNode. I am also running into this... I am using Animated.interpolateNode but I get the "_reactNativeReanimated.default.interpolateNode is not a function" error.

EDIT: Solved it by using interpolate (import { interpolate } from "react-native-reanimated";) and following the example from this page: https://docs.swmansion.com/react-native-reanimated/docs/utilities/interpolate