Skip to content

Commit 0694456

Browse files
authored
update stepper when value is 0 (#1609)
1 parent 8da3dbd commit 0694456

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/components/stepper/index.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import {isUndefined} from 'lodash';
12
import React, {PureComponent} from 'react';
23
import {StyleSheet, AccessibilityInfo, AccessibilityProps, AccessibilityActionEvent} from 'react-native';
34
import {Typography, Spacings} from '../../style';
@@ -94,7 +95,7 @@ class Stepper extends PureComponent<Props, State> {
9495
}
9596

9697
static getDerivedStateFromProps(nextProps: Props, prevState: State) {
97-
if (nextProps.value && prevState.currentValue !== nextProps.value) {
98+
if (!isUndefined(nextProps.value) && prevState.currentValue !== nextProps.value) {
9899
return ({currentValue: nextProps.value});
99100
}
100101
return null;

0 commit comments

Comments
 (0)