yipeng945 / reactjs-practice Goto Github PK
View Code? Open in Web Editor NEWReactJs
ReactJs
One suggestion:
For the css layout part, try use flexbox or CSS grid instead of float
, percentage of width, etc. It is more powerful and most of the companies have already moved to flexbox and CSS grid from traditional layout methods.
So suppose that the time when I press the start button is 0 sec
.
Then at 1.8 sec
the number showing is 1, I press reset button.
Then I should see the number jump to 0 from 1 (which is good in your code), also I should see the number jump to 1 from 0 at 2.8 sec
, because I reset the timer at 1.8 sec
.
The actual result of your code is that I will see the number jump to 1 from 0 at 2 sec
instead of 2.8 sec
.
Normally I don't talk about this issue, since you are good for the basic, I think it's good to let you know this.
You can try to implement the timer just using setTimeout
instead of setInterval
.
Glad to see you implemented the date process part yourself :)
Normally for Date/Time operations we don't do it by hand cause there is one standard library to do help us, check out moment.js: https://momentjs.com
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.