Nubescope / react-native-floating-hearts

Periscope floating hearts animation for React Native

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error: inputRange must be monotonically increasing 0,-32 at invariant

owenauch opened this issue · comments

I was trying to use this library by passing a new, increased prop for count to this component every time that it increased. However, I keep getting this error: Error: inputRange must be monotonically increasing 0,-32 at invariant.

When I log the prop value for count in the render method, it renders twice with the same count, which I think is the problem. Monotonically increasing would mean that it should never render with the same value or lower, only a larger one. So I'm not really sure how to fix this, because the render always runs twice in React, so the same props will be rendered twice.

Hey @owenauch, could you provide a minimal example and some steps to reproduce it? Thanks.

I don't think this is due to rendering the count. It's an animation error. The number on the right (-32) needs to be > 0.

I'm guessing the problem is here:
https://github.com/underscopeio/react-native-floating-hearts/blob/master/FloatingHearts.js#L146

Yes it is, I got it working. Thanks!

@owenauch how did u solve this issues

@tombaki
set height for parent view

<View style={{ width: 200, height: 200}}>
    <FloatingHearts count={count} />
</View>

still facing the same error
Screenshot 2021-12-30 at 2 44 12 PM

I am having the issue with android, its working fine in ios.
can someone please help me to find solution ? @nppull @AaronVasquez @tombaki @eramudeep