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:
Drew Bollinger 2015-11-24 15:41:33 -05:00
parent c14e8ae613
commit 3d034f43c0
2 changed files with 2 additions and 4 deletions

View File

@ -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);
},

View File

@ -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,