REACT-REDUX app not performing its action

Generally onKeyPress, onKeyUp, or onKeyDown will only be attached to some sort of form element.

<input type="text" onKeyPress={(event) => console.log(event.key)} />

if you specificly need the keypress from the window you will have to go about it a different way. I’ve included a couple examples on CodeSandbox.

Edit React Window Keyboard Events

1 Like