- Replace
<your_account>with your Github username in the DEMO LINK - Follow the React task guideline
Create a Clock component updating the time every second.
- use class component
- start the timer only when the component is added to the page
Watch this video to solve the next tasks
- Add buttons
Show ClockandHide Clockin the App changingisClockVisiblevariable in theAppstate. - The
Clockshould not be rendered whenisClockVisibleisfalse. - Change the
Clockcomponent to print the time not only on the page but also in theDevToolsconsole.- Stop the timer when the
Clockis hidden.
- Stop the timer when the
- Check if it works correctly:
- Hide and show the
Clockseveral times and leave it visible - The time in the console should be printed only once each second
- Hide and show the
- Add
Set random namebutton to theAppto set a random number as aclockNamevariable in theAppstate. - Pass the name to the
<Clock name={this.state.clockName} /> - Every time the
namechanges print a message in the consoleThe Clock was renamed from oldName to newName.- Check if the message appears in the console between clock ticks
