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

global "direction" variable

Open ibc opened this issue 9 years ago • 1 comments

In src/Hammer.js:

function updateHammer (hammer, props) {
        if (props.hasOwnProperty('vertical')) {
                console.warn('vertical is deprecated, please use `direction` instead');
        }

        var directionProp = props.direction;
        if (directionProp || props.hasOwnProperty('vertical')) {
                direction = directionProp ? directionProp : (props.vertical ? 'DIRECTION_ALL' : 'DIRECTION_HORIZONTAL');

so it's creating a global window.direction variable, which is a bug.

ibc avatar Sep 18 '16 22:09 ibc

eslint, jshint, jscs... etc etc. Please, check your code with any of them. They all would notify such a non declared variable (that hence becomes a global variable).

ibc avatar Sep 18 '16 22:09 ibc