React-native-calendars: Warning message after upgrade to React Native v0.62.1

Created on 5 Apr 2020  路  7Comments  路  Source: wix/react-native-calendars

Description

Warning message after upgrade to React Native 0.62.1.

Observed Behavior

When AgendView is rendered I receive this warning message:

Calling getNode() on the ref of an Animated component is no longer necessary. You can now directly use the ref instead. This method will be removed in a future release.

image

I believe it happens because some Animated methods have been deprecated.

Expected Behavior

Remove the getNode() call of all react-native-calendars components.

Environment

  • npm ls react-native-calendars:
$ npm ls react-native-calendars
[email protected] C:\projetos\ReactNative\govfacil-gabinete-app
`-- [email protected] 
  • npm ls react-native:
$ npm ls react-native
[email protected] C:\projetos\ReactNative\govfacil-gabinete-app
`-- (empty)

Reproducible Demo

I don't think it's necessary.

Bug report

All 7 comments

Any update on this issue

As workaround :
In node_modules/react-native-calendars/src/agenda/index.js :
At line 138 change : this.scrollPad.getNode().scrollTo({x: 0, y, animated});
with : this.scrollPad.scrollTo({x: 0, y, animated});

In node_modules/react-native-calendars/src/agenda/index.js :
At line 138 change : this.scrollPad.getNode().scrollTo({x: 0, y, animated});
with : this.scrollPad.scrollTo({x: 0, y, animated});

Fix it

This fixed my issue. The agenda was breaking with the following error: undefined this.scrollPad._component.scrollTo

Were you only getting a warning or was it causing the component to fail as well? I'm on react-native v0.62.2.

In node_modules/react-native-calendars/src/agenda/index.js :
At line 138 change : this.scrollPad.getNode().scrollTo({x: 0, y, animated});
with : this.scrollPad.scrollTo({x: 0, y, animated});

Fix it

Change code inside node_modules is a workaround, not a solution.

The warning is just a reminder message, it does not cause the app to crash for me.

@douglasjunior agreed it's not a solution. I was saying the app component is no longer broken for me after making this change. Any idea why it would be an error for me?

Screenshot_20200430-155431

I think you should to create a new issue to report that.

Resolved.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

matieux picture matieux  路  4Comments

idlework picture idlework  路  4Comments

filippoitaliano picture filippoitaliano  路  3Comments

sommeshEwall picture sommeshEwall  路  3Comments

sonnguyenit picture sonnguyenit  路  3Comments