diff --git a/src/App.tsx b/src/App.tsx
index f819cbdb9..a6ba95100 100644
--- a/src/App.tsx
+++ b/src/App.tsx
@@ -1,7 +1,38 @@
import React from 'react';
-export const App: React.FC = () => (
-
-
The last pressed key is [Enter]
-
-);
+type State = {
+ pressedKey: string;
+};
+
+export class App extends React.Component {
+ state: State = {
+ pressedKey: '',
+ };
+
+ componentDidMount() {
+ document.addEventListener('keyup', this.handlePressingKey);
+ }
+
+ componentWillUnmount() {
+ document.addEventListener('keyup', this.handlePressingKey);
+ }
+
+ handlePressingKey = (event: KeyboardEvent) => {
+ this.setState({ pressedKey: event.key });
+ };
+
+ render() {
+ const { pressedKey } = this.state;
+
+ return (
+
+
+
+ {pressedKey
+ ? `The last pressed key is [${pressedKey}]`
+ : 'Nothing was pressed yet'}
+
+
+ );
+ }
+}