react-native-nested-scroll-view icon indicating copy to clipboard operation
react-native-nested-scroll-view copied to clipboard

React-Native 0.54.4 Problem

Open rafael-paytuvi-devtence opened this issue 5 years ago • 6 comments

Hello.

We've worked with this plugin perfectly for the past months with my App in React Native 53.3 or lower. Recently, we have had to upgrade our React-Native version, so, we've upgraded version per version for testability and stability (f.e. 53.3 to 54.0, 54.0 to 54.4, 54.4 to 55 and so on).

However, we are currently stuck on React Native 54 because we've encountered Runtime errors preventing the App from executing correctly on Android as it crashes as soon it gets past the Splash screen. The error preventing the App from executing seems to be related to this plugin and it is:

ReactClassInterface: You are attempting to define 'UNSAFE_componentWillMount' on your component more than once. This conflict may be due to a mixin.

The problem occurs only on Android, when the line is present in any Container/Component and it does not matter if we've use the NestedScrollView component in the render:

import NestedScrollView from 'react-native-nested-scroll-view';

Our environment as right now is:

"react": "^16.3.0-alpha.1", "react-native": "0.54.4", "react-native-nested-scroll-view": "6.0.1"

Like you can see we are using the 6.0.1 version recommended for React Native versions lower than 0.56. Also, we've followed carefully the installation steps provided in the README.

Thank you for any help.

rafael-paytuvi-devtence avatar Oct 02 '18 09:10 rafael-paytuvi-devtence

Hi,

I am still not sure what is causing it, but it seems related to the react 16.3 version due its new lifecycle API, or an alpha release of react that you are using see https://reactjs.org/blog/2018/03/29/react-v-16-3.html

I don't think there's anything related to the library.

In fact the 6.0.1 was released in January 7 and react 16.3 was only relased at the end of the march, so i wasn't be able to supported that at the time of course.

I know that there are required react versions to work with react-native, but i don't know which versions is been required now, but i don't think you should use an alpha release of react 16.3.0.

This is supposed to mostly occurs on ios as well. Can you try to upgrade react? but i would still need to support 16.3 versions, and i don't think i could be able to do it for 6.0.1

cesardeazevedo avatar Oct 02 '18 09:10 cesardeazevedo

Hi,

In iOS the plugin reverts back to ScrollView, so it's not supposed to have this error, right? For us, it is working properly.

I'll try to update the React version and see what happens. I'll let you know what I find out.

rafael-paytuvi-devtence avatar Oct 02 '18 14:10 rafael-paytuvi-devtence

I literally forgot this project is android only, sorry 😂 Let me know if you got it.

cesardeazevedo avatar Oct 02 '18 15:10 cesardeazevedo

Hi,

I followed your advice and updated my version of React to 16.3.0 and 16.5.0. Sadly, none solved the problem.

I investigated a little bit more about the issue and the problem comes when the creating the React class for ScrollView on the lib/NestedScrollView.js file, because of importing the mixins of the ScrollResponder. I tried to remove the mixins import and try to rewrite each used function in the ScrollView class that is in the process of creating, but it got way complicated.

Is there something else you would advice doing? Aside from keep updating our version of ReactNative (we will definitely do it, just have to go version by version and test each one).

Thanks in advance.

rafael-paytuvi-devtence avatar Oct 03 '18 12:10 rafael-paytuvi-devtence

The NestedScrollView.js is just a fork from the original ScrollView.js, which uses that mixin https://github.com/facebook/react-native/blob/master/Libraries/Components/ScrollView/ScrollView.js#L553

The mixing is required to make the ScrollView work, does the original ScrollView also gives you that error as well?

cesardeazevedo avatar Oct 03 '18 17:10 cesardeazevedo

Hi, sorry for the delay.

We're still having the issue and we're giving up on the update to React Native 0.54.4. We're trying to update to 0.56 where the ReactNative ScrollView works as we want and, in worst case scenario, your plugin will work too.

To answer your question, the original ScrollView from ReactNative 0.54.4 does not give any errors whatsoever, I don't get it.

Thanks for everything

rafael-paytuvi-devtence avatar Oct 10 '18 15:10 rafael-paytuvi-devtence