react-native-stopwatch-timer's People
Forkers
larney11 arnesaknussemm89 louislatreille duongtranpyco duongifc kukendc luckyllama codelight89 necixy sure1243jupiter komkeao mattotodd vivianwang0709 gbaladi hungdev baskerville42 ribeiro-tiago aschui jigaryadav webimp teddyteh hitchcocknz jfedgar franklinsilva-forks dolby360 alexanderrr9 gasolin ibrahimahmed-io zacdemi dacello tssands sebvil samuelmarina firebulb sosweat moongikim forsh4w apiotrowski michaelgaras misterbillys livekid alyezz vuletuan plasticard cross19xx ruanlinos niftytushar calebvred antibiotika224 hoker addingama trentiums ronjovi rlatn1234 petinanamarija jianrontan jakerosewell mo7amed3lirw douglinhasmourareact-native-stopwatch-timer's Issues
timer minutes
hi there it is better to get the individual seconds and minutes from getTime instead of getting a formatted value from it
Stopping the stopwatch does not stop counting the time
Stopping the stopwatch does not stop counting the time. When you start the stopwatch again, it does not resume from the time it stopped. Instead,
Example scenario based on the TestApp example you provided:
- Start the stopwatch.
- Click "Stop" to stop the stopwatch on 00:00:05:00.
- Leave it stopped and wait about 10 seconds.
- Click "Start" to resume the stopwatch.
Expected stopwatch behavior: The stopwatch resumes from 00:00:05:000.
Actual behavior: The stopwatch resumes from about 00:00:15:000.
kinda ugly
ummmmm it's kinda ugly?
Issue with stop and start fixed by this LINE 69
this.interval = this.interval ? this.interval : setInterval(() => {
this.setState({elapsed: new Date() - this.state.startTime });
}, 1);
}
this.state.pausedTime deleted
getting the time from the stopwatch with getTime
getting the time from the stopwatch with getTime is not working as it keep showing my computer time only
Reset does not function correctly
So I am experiencing the issue , So when I press reset the Stopwatch goes back to 00:00:00 but when I press start again after pressing reset the stopwatch starts at 456294:34:08 and then starts counting up from there
Issue with stopwatch start and stop (Not resolved Properly)
The issue is not resolved properly as the more times we do start and stop it goes back more and more seconds in reverse then it shows like 0-1:55:46:342. Can you please take a look. Thanks in advance
Warning: componentWillReceiveProps has been renamed, and is not recommended for use.
I get this warning for the Timer component:
Warning: componentWillReceiveProps has been renamed, and is not recommended for use. See https://fb.me/react-unsafe-component-lifecycles for details.
- Move data fetching code or side effects to componentDidUpdate.
- If you're updating state whenever props change, refactor your code to use memoization techniques or move it to static getDerivedStateFromProps. Learn more at: https://fb.me/react-derived-state
- Rename componentWillReceiveProps to UNSAFE_componentWillReceiveProps to suppress this warning in non-strict mode. In React 17.x, only the UNSAFE_ name will work. To rename all deprecated lifecycles to their new names, you can run
npx react-codemod rename-unsafe-lifecycles
in your project source folder.
getMsecs slows down the counter
getMsecs function slows down the counter response so it switches seconds slower sometimes and it may even skip seconds sometime.
How to use multiple Timers in FlatList
Hi, Is there a way for using multiple Timers in a FlatList?
Right now using 5 Timers at the same time makes other Timers unresponsive, and button onPress is not responding.
I know this is not an issue related directly to this component but I can't think of a way to make it work.
Any ideas?
Memory leaks when component is unmounted
If component is unmounted, the intervals set by setInterval
never get cleared and the timer continues counting in the background. This is a problem and creates memory leaks.
Change text style on setState
I would love to be able to change the text style (options) on a state change.
eg; go from white text to green text when stopwatch is running.
Not sure how I would do this, any thoughts?
Modal disables start/pause button
If I open and close a modal, while the timer has been running the play/pause button doesn't work anymore and the timer will keep on running.
Any advice much appreciated!
Here is a screen recording: https://www.dropbox.com/s/gczdpb6ir122jv1/Screen%20Recording%202020-05-03%20at%2014.14.58.mov?dl=0
Here is my code:
import React, { useState, Component } from 'react';
import { View, Button, Modal } from 'react-native';
import { Timer } from 'react-native-stopwatch-timer';
function Pomodoro(props) {
const [timerStart, setTimerStart] = useState(false);
const [timerReset, setTimerReset] = useState(false);
const [isSettingsVisible, setIsSettingsVisible] = useState(false);
const totalDuration = 100000;
const toggleTimer = () => {
setTimerStart(!timerStart);
setTimerReset(false);
};
const handleTimerComplete = () => {
setTimerStart(false);
setTimerReset(true);
};
const toggleModal = () => {
setIsSettingsVisible(!isSettingsVisible);
}
return (
<View style={{ alignItems: 'center', marginTop: 100 }}>
<Button title='Settings' onPress={toggleModal} />
<Modal visible={isSettingsVisible}>
<View style={{ marginTop: 100 }}>
<Button title="Close" onPress={toggleModal} />
</View>
</Modal>
<View>
<Timer
totalDuration={totalDuration}
start={timerStart}
reset={timerReset}
handleFinish={handleTimerComplete}
/>
</View>
<View>
<Button onPress={toggleTimer} title={!timerStart ? 'Start' : 'Pause' } />
</View>
</View>
);
}
export default Pomodoro;
GetTime method is undefined
i need to send the time to server so, while saving the time in local state variable using setstate({}) funtion under GetTime Callback the setstate function is undefined under gettime call back any workaround how to get the counter time ?
Stopwatch is pause. when app in background mode or lock device screen.
Issue with reset for Timer
Resetting the timer with a new duration doesn't apply the new duration. I tried submitting a PR, as the fix is very simple, but pushes are not allowed.
Get displayed time function
I am working on an app where the stopwatch time must be stored to the database.
Is it possible to get the time that is displayed in the stopwatch?
Is there a way to reset and start in one setState() call?
Hey amazing git! Really appreciate your work.
I'm looking to reset and start the stopwatchTimer in one call. But it seems this doesn't work.
componentDidUpdate(prevProps, prevState) {
if ( some conditions ) {
this.resetStopWatchTimer()
this.setStopwatch();
//////
}
setStopwatch() {
this.setState({stopwatchStart: true, stopwatchReset: false});
};
resetStopWatchTimer() {
this.setState({stopwatchStart: false, stopwatchReset: true});
};
In this case, it just keeps ticking.
Then I tried to do something inbetween like this
this.setState({stopwatchStart: true, stopwatchReset: true)}
And I think this "technically" works, but the stopwatch timer then loses its formatted time styling.
Anyways, I was curious what you think. I would be more than happy to contribute a fork if you think there's something missing here. I'm hoping for the chance that I'm actually just being dumb and there's a better way to do it. ๐
Style Issue
the style isn't changed when I change text size or background color, nothing happen.
Bug display, react-native v 0.53
iOS screen freezing completely when resume app from the background
I am developing one react native application for android and iOS.
In, Android everything is working fine but facing one issue with iOS app.
Issue :
- In one of my screen I am using Stopwatch component and few other buttons.
- When I am on that screen and send iOS application in background and resume again from background, all buttons stopped working and screen looks like it freeze completely.
- In this case, I will have to kill application and start again.
Please do needful.
Stopwatch auto refresh at 23:00:00 - 24:00:00 why this happen android.
Set timer
Hello, thanks for this package.
Is there a where to specify what time to start the timer ?
like start from 01:22:00 instead of 00:00:00
Thanks.
Regards
How to disable hours?
currently I only need minutes and seconds, How I can disable hours?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.