react-native-ratings
react-native-ratings copied to clipboard
Does not work with React Navigation, esp. on second render
Steps to reproduce:
- Works OK on first render (but sometimes swiping re-renders the whole screen and thus resets other state values)
- Unfocus the screen by navigation.navigate or navigation.goBack
- Refocus the screen
onStartRating,onSwipeRating,onFinishRatingwill always return 0. And the rating component cannot be swiped
<Rating
onStartRating={console.log}
onSwipeRating={console.log}
onFinishRating={console.log}
/>
React Native: 0.64.1 Platform: iOS 14.5 iphone12 Simulator React Navigation: 5 React Native Ratings: 7.6.1 ~ 8.1.0
Workaround
I've used react-native-ratings with react-navigation without any problem last year.
I've looked into the package.json in my old project and downgraded version to 7.2.0
It's starting to work again. 🤔