mirror of
https://github.com/visgl/react-map-gl.git
synced 2026-01-18 15:54:22 +00:00
[3.0-release] fix unbound this in ref callback for canvas-overlay (#337)
This commit is contained in:
parent
0df9478e7a
commit
dedd87d0de
@ -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();
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user