For whatever reason react-keyboard-event-handler doesn't appear to work with https://material-ui.com/api/dialog/
It works outside of it but in a Dialog, nothing.
For anyone googling about the subject, on hindsight realised I was being dumb spending time debugging when all I needed was
useEffect(() => {
const handleKey = (e) => {
if (e.key >= 1 && e.key < 10) setStars(Number(e.key))
}
window.addEventListener('keydown', handleKey)
return () => window.removeEventListener('keydown', handleKey)
},[])
(of course unmount the component to unregister listener instead of just hiding it)