From bcbd2e74a6c10d388835d5329b91d14d5913919f Mon Sep 17 00:00:00 2001 From: mrmicrowaveoven Date: Wed, 17 Jan 2024 18:04:45 -0600 Subject: [PATCH 1/3] Added to description of id --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 0cb0cef..dbc36b8 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ Run `npm install react-native-countdown-component --save` OR `yarn add react-nat ## Props | Name | Description | Type | Default Value | | :--- | :----- | :--- | :---: | -| id | Counter id, to determine whether to reset the counter or not | string | null | +| id | Counter id, to determine whether to reset the counter or not. To reset the timer, change this value | string | null | | style | Override the component style | object | {} | | digitStyle | Digit style | object | {backgroundColor: ![#FAB913](https://placehold.it/15/FAB913/000000?text=+) `'#FAB913'`} | | digitTxtStyle | Digit Text style | object | {color: ![#FAB913](https://placehold.it/15/000000/000000?text=+) `'#000'`} | From 1eef17fc2a90d84d40dff36635abf99036af33f0 Mon Sep 17 00:00:00 2001 From: mrmicrowaveoven Date: Wed, 17 Jan 2024 18:17:14 -0600 Subject: [PATCH 2/3] Added example of resetting the timer --- README.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/README.md b/README.md index dbc36b8..03e9ffe 100644 --- a/README.md +++ b/README.md @@ -94,3 +94,22 @@ render() { ) } ``` +## Reset Timer + +To reset the timer, the `id` property must be changed. Below is a simple example. + +```javascript +import CountDown from 'react-native-countdown-component'; + +const [timerId, setTimerId] = useState(Math.random().toString()) + +const resetTimer = () => {setTimerId(Math.random().toString())} + +return ( + +) +``` \ No newline at end of file From 469b6a91665ea2252cc8d37abd7cbaf81a9b3929 Mon Sep 17 00:00:00 2001 From: mrmicrowaveoven Date: Wed, 17 Jan 2024 18:19:04 -0600 Subject: [PATCH 3/3] Updated timeLabels to be undefined, to avoid type conflicts --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 03e9ffe..178505d 100644 --- a/README.md +++ b/README.md @@ -88,7 +88,7 @@ render() { timeLabelStyle={{color: 'red', fontWeight: 'bold'}} separatorStyle={{color: '#1CC625'}} timeToShow={['H', 'M', 'S']} - timeLabels={{m: null, s: null}} + timeLabels={{m: undefined, s: undefined}} showSeparator /> )