Create a class component Clock
updating the time every second using a given markup.
Time should be printed on the page and in the DevTools console.
componentDidMount
)setInterval
.App
to be a class componentshasClock
variable to the App
state.Clock
should be visible only when hasClock
is true
.document
(contextmenu
event)
document.addEventListener('contextmenu', () => {});
document
(click
event)
document.addEventListener('click', () => {});
componentWillUnmount
)clockName
to the App
state using getRandomName
function (already implemented)Clock
to be show near the time (see the markup)
<Clock name={this.state.clockName} />
clockName
every 3300ms
with a new random name (use setInterval
)name
changes the Clock
must print a message with an old name and a new name to the console (componentDidUpdate
)
Renamed from <oldName> to <newName>
<your_account>
with your Github username in the
DEMO LINK