diff --git a/src/components/counter.js b/src/components/counter.js index 3f46b7b..0c253e2 100644 --- a/src/components/counter.js +++ b/src/components/counter.js @@ -19,7 +19,11 @@ export default class Counter extends Component { beforeLoading: false, }; } - + componentDidUpdate(prevProps) { + if (prevProps.start !== this.props.start) { + this.setState({ count: this.props.start }); + } + } onPress(count, type) { const { onChangeBefore } = this.props;