Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Android] App crash randomly (scrollToOffset) #158

Closed
KarlosQ opened this issue Sep 21, 2017 · 10 comments
Closed

[Android] App crash randomly (scrollToOffset) #158

KarlosQ opened this issue Sep 21, 2017 · 10 comments
Labels

Comments

@KarlosQ
Copy link

KarlosQ commented Sep 21, 2017

Sometimes, randomly, the app crash in Android.

The error:

imagen

Carousel props:

imagen

React-native versions I tried: 0.47.1 and 0.48.3
react-native-snap-carousel: 3.2.3
Android Studio Simulator (API 22)

@wildvalcom
Copy link

+1 for me this usually happens when I rotate device with the js debugging mode turned on

@bd-arc
Copy link
Contributor

bd-arc commented Sep 22, 2017

I think I know where the problem is. I will push a fix as soon as possible and will ask you guys to try it before releasing it.

@bd-arc bd-arc added the bug label Sep 22, 2017
@KarlosQ
Copy link
Author

KarlosQ commented Sep 22, 2017

Thanks you! Which is the stable version for Android?

@bd-arc
Copy link
Contributor

bd-arc commented Sep 22, 2017

If my guess is correct, you shouldn't have any issue with version 3.1.0.

@bd-arc
Copy link
Contributor

bd-arc commented Sep 22, 2017

@KarlosQ @wildvalcom This commit should solve the issue. Can you confirm?

To test it:

"react-native-snap-carousel": "https://github.com/archriss/react-native-snap-carousel#8b65fb7"

If you want a deeper understanding of the issue at stake, see this React Native thread. Basically, you should apparently avoid using stateless components when rendered inside scroll components. They should be migrated to regular components that extend Component or PureComponent. See this comment or this one.

@bd-arc bd-arc closed this as completed Sep 22, 2017
@wildvalcom
Copy link

@bd-arc well, with this fix everything works as expected. Are you planing to merge this fix into master?

@bd-arc
Copy link
Contributor

bd-arc commented Sep 25, 2017

@wildvalcom It has already been merged, just not published on NPM yet ;-)

I'll publish a new release when I'm done fixing a few other issues.

@KarlosQ
Copy link
Author

KarlosQ commented Sep 26, 2017

@bd-arc No more crash, thank you!

@aschenkel
Copy link

Thanks @bd-arc!
Just wanted to appreciate the effort and support this package has, it is great

@bd-arc
Copy link
Contributor

bd-arc commented Dec 5, 2017

You're welcome @aschenkel. Always good to hear though ;-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants