mirror of
https://github.com/visgl/react-map-gl.git
synced 2026-01-25 16:02:50 +00:00
Remove ReactDOM.findDOMNode calls from src
Per the react docs, this use case is discouraged and can be replaced with the ref itself. It also allows the removal of ReactDOM from the src require statements https://facebook.github.io/react/docs/top-level-api.html#reactdom.finddomnode
This commit is contained in:
parent
c14e8ae613
commit
3d034f43c0
@ -20,7 +20,6 @@
|
||||
'use strict';
|
||||
|
||||
var React = require('react');
|
||||
var ReactDOM = require('react-dom');
|
||||
var MapboxGL = require('mapbox-gl');
|
||||
var Point = MapboxGL.Point;
|
||||
var document = require('global/document');
|
||||
@ -79,7 +78,7 @@ var MapInteractions = React.createClass({
|
||||
},
|
||||
|
||||
_getMousePos: function _getMousePos(event) {
|
||||
var el = ReactDOM.findDOMNode(this.refs.container);
|
||||
var el = this.refs.container;
|
||||
return mousePos(el, event);
|
||||
},
|
||||
|
||||
|
||||
@ -21,7 +21,6 @@
|
||||
|
||||
var assert = require('assert');
|
||||
var React = require('react');
|
||||
var ReactDOM = require('react-dom');
|
||||
var debounce = require('debounce');
|
||||
var r = require('r-dom');
|
||||
var d3 = require('d3');
|
||||
@ -253,7 +252,7 @@ var MapGL = React.createClass({
|
||||
mapStyle = this.props.mapStyle;
|
||||
}
|
||||
var map = new MapboxGL.Map({
|
||||
container: ReactDOM.findDOMNode(this.refs.mapboxMap),
|
||||
container: this.refs.mapboxMap,
|
||||
center: [this.state.longitude, this.state.latitude],
|
||||
zoom: this.state.zoom,
|
||||
style: mapStyle,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user