ptomasroos / react-native-scrollable-tab-view

Tabbed navigation that you can swipe between, each tab can have its own ScrollView and maintain its own scroll position between swipes. Pleasantly animated. Customizable tab bar
https://www.npmjs.com/package/react-native-scrollable-tab-view
6.93k stars 2.28k forks source link

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

Open Brijesh59 opened 3 years ago

Brijesh59 commented 3 years ago

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

cyim02 commented 3 years ago

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

Prajwalrajbasnet commented 3 years ago

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.

fjaffrezic commented 3 years ago

+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 ?

the-smart-home-maker commented 2 years ago

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.

Mark7888 commented 2 years ago

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

the-smart-home-maker commented 2 years ago

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 commented 2 years ago

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",

waleedshkt commented 2 years ago

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

rawaniharsh commented 2 years ago

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

liuyao0 commented 2 years ago

perfect!

Judefabi commented 2 years ago

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

ortegarenzy commented 2 years ago

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