react-native-floating-hearts icon indicating copy to clipboard operation
react-native-floating-hearts copied to clipboard

TypeError: undefined is not an object (evaluating '_reactNative.View.propTypes.style')

Open taymisuprbiz opened this issue 4 years ago • 6 comments

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

taymisuprbiz avatar Oct 09 '20 16:10 taymisuprbiz

Go into your ~/node_modules/react-native-floating-hearts/FloatingHearts.js & change line 177 from View.propStyles to ViewPropStyles

rajaweise avatar Oct 09 '20 17:10 rajaweise

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

taymisuprbiz avatar Oct 09 '20 17:10 taymisuprbiz

Is there any other npm package that works asides this? Owner seems to have gone away or on holidays

taymisuprbiz avatar Oct 09 '20 17:10 taymisuprbiz

Sorry not ViewPropStyles, line 177 should be this: style: ViewPropTypes.style,

rajaweise avatar Oct 09 '20 17:10 rajaweise

@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>

taymisuprbiz avatar Oct 11 '20 19:10 taymisuprbiz

Sorry not ViewPropStyles, line 177 should be this: style: ViewPropTypes.style,

This fix worked for me. Thanks a lott 👍

venkatram090993 avatar Oct 28 '20 07:10 venkatram090993