react-native-floating-hearts
react-native-floating-hearts copied to clipboard
TypeError: undefined is not an object (evaluating '_reactNative.View.propTypes.style')
TypeError: undefined is not an object (evaluating '_reactNative.View.propTypes.style')
This error shows
"react-native": "0.63.2", "react-native-elements": "^2.3.2", "react-native-floating-hearts": "^0.0.9",
Go into your ~/node_modules/react-native-floating-hearts/FloatingHearts.js & change line 177 from View.propStyles to ViewPropStyles
Go into your ~/node_modules/react-native-floating-hearts/FloatingHearts.js & change line 177 from View.propStyles to ViewPropStyles
it does not work still. The floating hearts never come up or at times ReferenceError: Can't find variable: ViewPropStyles
Is there any other npm package that works asides this? Owner seems to have gone away or on holidays
Sorry not ViewPropStyles, line 177 should be this:
style: ViewPropTypes.style,
@rajaweise Thanks
But how does the floating heart activate? I am trying to use it as an action when a Touchable is pressed
const toggleLike = () => {
setCountHeart(20);
};
<FloatingHearts
count={0}
renderCustomShape={() => {
return <View style={styles.hearts} />;
}}
/>
<TouchableOpacity onPress={() => toggleLike()}>
<LikedIcon
width="30"
height="30"
style={{alignSelf: 'center'}}
/>
</TouchableOpacity>
Sorry not ViewPropStyles, line 177 should be this:
style: ViewPropTypes.style,
This fix worked for me. Thanks a lott 👍