[3.0-release] fix unbound this in ref callback for canvas-overlay (#337)

This commit is contained in:
Anh Mai 2017-08-01 13:08:49 -07:00 committed by GitHub
parent 0df9478e7a
commit dedd87d0de

View File

@ -22,6 +22,7 @@ import {Component, createElement} from 'react';
import PropTypes from 'prop-types';
import {PerspectiveMercatorViewport} from 'viewport-mercator-project';
import {window} from '../utils/globals';
import autobind from '../utils/autobind';
const propTypes = {
redraw: PropTypes.func.isRequired
@ -33,6 +34,11 @@ const contextTypes = {
};
export default class CanvasOverlay extends Component {
constructor(props) {
super(props);
autobind(this);
}
componentDidMount() {
this._redraw();
}