react-native-scrollable-tab-view icon indicating copy to clipboard operation
react-native-scrollable-tab-view copied to clipboard

Calling 'getNode()' on the ref of an Animated component is no longer necessary.

Open Brijesh59 opened this issue 4 years ago • 12 comments
trafficstars

Getting this warning when switching the tab - 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.

This issue exists in goToPage(pageNumber) method.

Steps to Reproduce

Expected Behavior

Actual Behavior

Brijesh59 avatar Mar 24 '21 17:03 Brijesh59

+1 same issue here. by removing all the getNode() at node_modules/react-native-scrollable-tab-view/index.js will temporarily solve the problem.

cyim02 avatar Mar 31 '21 11:03 cyim02

For now I did temporary fix by installing the package directly from the repo using yarn add ptomasroos/react-native-scrollable-tab-view or you can do npm i ptomasroos/react-native-scrollable-tab-view if you're using npm. The codebase in the repo already seems to be updated and got rid of getNode() however it doesn't seem to be gone to release.

Prajwalrajbasnet avatar Apr 01 '21 18:04 Prajwalrajbasnet

+1 same issue here. by removing all the getNode() at node_modules/react-native-scrollable-tab-view/index.js will temporarily solve the problem. A release is planned ?

fjaffrezic avatar May 07 '21 07:05 fjaffrezic

Hi there,

I just upgraded to React Native 0.65.1 and now I am even receiving an error, not only a warning, on this topic. When pressing a Tab, the following error message appears (and makes the app crash in production mode): TypeError: this.scrollView.getNode is not a function. (In 'this.scrollView.getNode()', 'this.scrollView.getNode' is undefined)

As explained above, by removing all the getNode() calls at node_modules/react-native-scrollable-tab-view/index.js, we can temporarily solve the problem. But due to the fact that it is now an error and not only a warning any more, I guess it makes sense to soon fix this in a new release of the package.

the-smart-home-maker avatar Sep 16 '21 03:09 the-smart-home-maker

+1 Same here. removing getNode() in index.js fixed, but waiting for fix

Mark7888 avatar Sep 19 '21 22:09 Mark7888

Hi there, is there a plan on when this will be fixed in the npm package? It seems like on the master branch, this has already be fixed. So we would just need to push that change to npm?

the-smart-home-maker avatar Feb 06 '22 05:02 the-smart-home-maker

ok, for now I was able to fix this by rewriting the entry in my package.json like this in order to ensure that npm pulls from the master branch: "react-native-scrollable-tab-view": "ptomasroos/react-native-scrollable-tab-view#master",

the-smart-home-maker avatar Feb 06 '22 06:02 the-smart-home-maker

I don't know where this repo's maintainers are. They have clearly been inactive. Someone has got to look at all that pile of PRs and issue. The pressure needs to be bore by some willing and keen souls one way or another!!

Better move to much better and updated react-native-collapsible-tab-view. It's seemingly built on top of react-native-tab-view

waleedshkt avatar Feb 22 '22 21:02 waleedshkt

Hi All, use this package react-native-top-tab-view. It fixed the issue.

rawaniharsh avatar Mar 14 '22 17:03 rawaniharsh

perfect!

liuyao0 avatar Mar 15 '22 15:03 liuyao0

You can also avoid calling getNode() in general. It also works. For instance I had _scrollView.current.getNode().scrollTo({x: x, y: 0, animated: true}) and just changed it to _scrollView.current.scrollTo({x: x, y: 0, animated: true}). Solved the issue and the error was gone

Judefabi avatar May 21 '22 02:05 Judefabi

You can also avoid calling getNode() in general. It also works. For instance I had _scrollView.current.getNode().scrollTo({x: x, y: 0, animated: true}) and just changed it to _scrollView.current.scrollTo({x: x, y: 0, animated: true}). Solved the issue and the error was gone

The simplest solution that works well

ortegarenzy avatar Jul 30 '22 13:07 ortegarenzy