react-hammerjs
react-hammerjs copied to clipboard
Update Documentation or Expose Constants
Currently documentation seems to imply that constants are on the library:
import Hammer from 'react-hammerjs';
console.log(Hammer.DIRECTION_LEFT) //actually undefined
console.log(window.Hammer.DIRECTION_LEFT) //works
In any case, I would vote that the underlying Hammer object shouldn't be exposed globally and should be contained to the package.
Yes, i need it too ^^
but about window.Hammer, there is a proper way for doing this :
import Hammer from 'react-hammerjs';
import { DIRECTION_LEFT, DIRECTION_RIGHT } from 'hammerjs';
because hammerjs is a dependency of react-hammerjs