Create a Digital Clock using React

Digital Clock

  • Create a Digital Clock using React using class Date.
  • When Digital Clock is mounted a Digital Clock should update the state variable time with current Time.
  • This Digital Clock should update the time variable regularly at an interval of 1 sec.
  • When the component is unmounted then Digital Clock should be terminated to freeUp resources.

Acceptance Criteria

  • Use of JavaScript class Date.
  • Update Digital Clock in Every second.
  • Terminate Digital Clock on unmounting.
  • Main div should have class name ‘Clock’.
  • Inside main div create a h3 tag element with id ‘time’, and put your time string inside it.

Time Format

  • 1:13:53 PM
  • HH:MM:SS{space}PM
  • HH:MM:SS{space}AM

Download Details:

Author: rutvik-pimple

Source Code: https://github.com/rutvik-pimple/React-Assignments---Digital-Clock

#react #reactjs #javascript

Create a Digital Clock using React
36.80 GEEK