From 5ff9b6d522e0ea2e682d800ba18bde8efcbcc9c9 Mon Sep 17 00:00:00 2001 From: Oussama Bougaila Date: Thu, 21 Mar 2019 08:57:20 +0100 Subject: [PATCH] feat: Add the remaining time to onChange()'s props --- index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index 689d293..1e536fd 100644 --- a/index.js +++ b/index.js @@ -102,7 +102,7 @@ class CountDown extends React.Component { this.props.onFinish(); } if (this.props.onChange) { - this.props.onChange(); + this.props.onChange(until); } } @@ -110,7 +110,7 @@ class CountDown extends React.Component { this.setState({lastUntil: 0, until: 0}); } else { if (this.props.onChange) { - this.props.onChange(); + this.props.onChange(until); } this.setState({lastUntil: until, until: until - 1}); }