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

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

Open
taymisuprbiz opened this issue Oct 9, 2020 · 6 comments

Comments

@taymisuprbiz
Copy link

taymisuprbiz commented Oct 9, 2020

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

@rajaweise
Copy link

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

@taymisuprbiz
Copy link
Author

taymisuprbiz commented Oct 9, 2020

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
Copy link
Author

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

@rajaweise
Copy link

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

@taymisuprbiz
Copy link
Author

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

@venkatram090993
Copy link

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

This fix worked for me. Thanks a lott 👍

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

No branches or pull requests

3 participants