Skip to content

deepak00011/react30_3_digital_clock

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

react30_3_digital_clock

All Contributors

Digital clock app using react.js

Objective:

Build a digital clock app using react.js

Learnings:

How to use useEffect hook in react.js and setInterval method in Javascript.

useEffect

What does useEffect do?
By using this Hook, you tell React that your component needs to do something after render. React will remember the function you passed (we'll refer to it as our “effect”), and call it later after performing the DOM updates.

When Should You use useEffect?
Well, the idea to use useEffect hook is to execute code that needs happens during lifecycle of the component instead of on specific user interactions or DOM events.

Implementations:

1st Solution:

2nd Solution:

Available Scripts

In the project directory, you can run:

yarn start

Runs the app in the development mode.
Open http://localhost:3000 to view it in the browser.

The page will reload if you make edits.
You will also see any lint errors in the console.

yarn test

Launches the test runner in the interactive watch mode.
See the section about running tests for more information.

yarn build

Builds the app for production to the build folder.
It correctly bundles React in production mode and optimizes the build for the best performance.

The build is minified and the filenames include the hashes.
Your app is ready to be deployed!

Contributors ✨

Thanks goes to these wonderful people (emoji key):


bineetNaidu

📖

Bogumił Morawski

💻

This project follows the all-contributors specification. Contributions of any kind welcome!

About

A simple digital clock made with react.js hooks

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 66.3%
  • CSS 17.6%
  • HTML 16.1%