React-native-reanimated: useCode() first argument should be a function that returns an animation node.

Created on 22 Jul 2020  路  12Comments  路  Source: software-mansion/react-native-reanimated

Description

After upgrade for latest version of reanimated today i am getting this error in many places in app:

console.warn(
   'useCode() first argument should be a function that returns an animation node.'
);

I am not using this hook at all, at least i am not aware of using it.
Stack trace from LogBox is not telling me which component it is causing by.

May be related to this ? https://github.com/software-mansion/react-native-reanimated/pull/952/files

Screenshots

IMG_CA0E9CD67CFC-1

Package versions

  • React: 16.13.1
  • React Native:0.63.2
  • React Native Reanimated: 1.10.0

using also

  • react-native-screens - 2.9.0
  • react-navigation v5
鈿爄mportant 馃悶 Bug

Most helpful comment

Seems like BottomSheet uses nodes directly instead of passing the function, I overlooked that. Will fix that quickly.

Thanks for reporting!

All 12 comments

It's definitely connected to #952. It shouldn't show up if somebody uses Animated.Code as intended (or I forgot about some use case when doing this PR 馃檪).

Could you please run grep on the entire project (with node_modules included) with string <Animated.Code and <Code? It should find all usages of it.

You can use LogBox.ignoreLogs(['useCode() first argument should be a function that returns an animation node.']); temporarily to disable this warning.

sure, will ingore this for now.

@react-navigation/drawer
react-native-draggable-gh-list
react-native-reanimated/lib/module/core/Core.test.js
reanimated-bottom-sheet

Some of my dependecies which are using it.

Could you please include versions of those packages as well? You can check it in the package.json file.

@react-navigation/drawer - 5.8.6
react-native-draggable-gh-list - 0.1.1 - its our internal
reanimated-bottom-sheet - 1.0.0-alpha.20
React Native Reanimated: 1.10.0

Seems like BottomSheet uses nodes directly instead of passing the function, I overlooked that. Will fix that quickly.

Thanks for reporting!

@alimek I released 1.10.1, can you check if it works?

@alimek I released 1.10.1, can you check if it works?

I had the same problem, but with version 1.10.1 it was resolved.

yup, working fine :) thanks again for quick fix ;-) 馃憤

I am facing same issue and using the updated version "react-native-reanimated": "^1.13.2" .If anybody could help?

Could you post the code that raises this error? Please clear all caches.

Could you post the code that raises this error? Please clear all caches.

I have resolved this issue from stack overflow solution, installong packages using expo install instead of yarn add.

Was this page helpful?
0 / 5 - 0 ratings