react-hammerjs icon indicating copy to clipboard operation
react-hammerjs copied to clipboard

Update Documentation or Expose Constants

Open wlingke opened this issue 9 years ago • 1 comments

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.

wlingke avatar Oct 14 '16 01:10 wlingke

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

guillaumearm avatar Dec 14 '16 21:12 guillaumearm