Make the App
a class component with pressedKey
in the state
.
- Before any key was pressed show a message
Nothing was pressed yet
- When a key is pressed show
The last pressed key is <event.key>
- use
componentDidMount
to addkeyup
handlerdocument.addEventListener('keyup', (event: KeyboardEvent) => { console.log(event.key); });
removeEventListener
when component is removed from the page
IMPORTANT This task does not have tests yet
- Implement a solution following the React task guideline
- Use React TypeScript cheat sheet
- Replace
<your_account>
with your Github username in the DEMO LINK and add it to PR description