glenjamin / react-hotkey

A simple mixin for application hotkeys
MIT License
35 stars 12 forks source link

React 16 Import Error #14

Open naderm opened 7 years ago

naderm commented 7 years ago

It looks liker react-hotkey is not compatible with the current release candidate of React 16 (16.0.0-rc.3). On application startup I get the following error:

Uncaught Error: Cannot find module 'react-dom/lib/SyntheticKeyboardEvent'

...\node_modules\react-hotkey\index.js:2:30)

It looks like this module doesn't exist in that location any more in react-dom. It looks like it is now only defined in react-dom.development.js and it is not in module.exports, make it difficult to access. Given that this was a private method, I'm not sure what part of react/react-dom should be used for an updated keyboard event handler.

glenjamin commented 7 years ago

I suspect this is no longer allowed

naderm commented 7 years ago

Is there an easy fix to get keyboard events in 16.0.0?

It looks like the other package react-hotkeys uses a class mixin, but may also be having issues https://github.com/chrisui/react-hotkeys/issues/67

neilyoung commented 6 years ago

Still not fixed :(