-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Fix Detected a division by zero in Animated.divide node #764
Conversation
On first render width is 0 which is causing Detected a division by zero in Animated.divide node.
+1 this is a major issue |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
index.js
Outdated
@@ -329,7 +329,7 @@ const ScrollableTabView = createReactClass({ | |||
_handleLayout(e) { | |||
const { width, } = e.nativeEvent.layout; | |||
|
|||
if (Math.round(width) !== Math.round(this.state.containerWidth)) { | |||
if (width > 0 && Math.round(width) !== Math.round(this.state.containerWidth)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you consider returning early ?
ex:
if (!width || Math.round(width) === Math.round(this.state.containerWidth) {
return
}
@syzer returning early now. |
@chaitanya0bhagvan Why did you delete the branch? It still does not work. |
@adamski This is already merged but a new version is not pushed to npm. |
Ok great, I'll use the git url instead, thanks |
Fix Detected a division by zero in Animated.divide node
Fix Detected a division by zero in Animated.divide node
On first render width is 0 which is causing Detected a division by zero in Animated.divide node.