Skip to content

Commit

Permalink
fix(svg): Remove references to global.
Browse files Browse the repository at this point in the history
* assume SVGElement can be defined in a global namespace.

Fixes issues when draggable is run a second time through Babel.

Fixes react-grid-layout#162
  • Loading branch information
Anton Ivanov authored and STRML committed Aug 15, 2016
1 parent 1cda7bf commit 8542089
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/Draggable.es6
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ export default class Draggable extends React.Component {

componentDidMount() {
// Check to see if the element passed is an instanceof SVGElement
if(typeof global.SVGElement !== 'undefined' && ReactDOM.findDOMNode(this) instanceof global.SVGElement) {
if(typeof SVGElement !== 'undefined' && ReactDOM.findDOMNode(this) instanceof SVGElement) {
this.setState({ isElementSVG: true });
}
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,4 +69,4 @@
"dependencies": {
"classnames": "^2.2.5"
}
}
}

0 comments on commit 8542089

Please sign in to comment.