Skip to content

Commit 11aec54

Browse files
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.
1 parent ff5ccb5 commit 11aec54

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,7 @@ const ScrollableTabView = createReactClass({
329329
_handleLayout(e) {
330330
const { width, } = e.nativeEvent.layout;
331331

332-
if (Math.round(width) !== Math.round(this.state.containerWidth)) {
332+
if (width > 0 && Math.round(width) !== Math.round(this.state.containerWidth)) {
333333
if (Platform.OS === 'ios') {
334334
const containerWidthAnimatedValue = new Animated.Value(width);
335335
// Need to call __makeNative manually to avoid a native animated bug. See

0 commit comments

Comments
 (0)