Capture the keycode from a keypress in React

Default
,

hello,
I've hit a point in my app where I want to dispatch an action with the keycode from any given keypress passed in as a property to the action. I keep getting errors when I'm just trying to console.log the key character.

When I do this:

class DrumMachine extends React.Component {

componentDidMount() {
document.addEventListener('keypress', console.log(event.key));
}
UC Browser Downloadend componentWillUnmount() {
document.removeEventListener('keypress');
}
I get the error Uncaught (in promise) DOMException: Failed to load because no supported source was found.

When I try this:
SHAREit Apk Downloadendclass DrumMachine extends React.Component {

componentDidMount() {
document.addEventListener('keypress', drumKeyPress((e) => console.log(e.key)));
}
MX Player Downloadend componentWillUnmount() {
document.removeEventListener('keypress', drumKeyPress());
}
I get the same error. I'm confident that once I can log the event key I can figure the rest out on my own, but for now I'd just like to understand why what I'm doing isn't working.