mirror of
https://github.com/google-map-react/google-map-react.git
synced 2025-12-08 18:26:32 +00:00
Moves marker dispatcher binds to componentDidMount (#873)
This commit is contained in:
parent
fe76674757
commit
307476f02e
@ -48,13 +48,6 @@ export default class GoogleMapMarkers extends Component {
|
||||
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.props.dispatcher.on('kON_CHANGE', this._onChangeHandler);
|
||||
this.props.dispatcher.on(
|
||||
'kON_MOUSE_POSITION_CHANGE',
|
||||
this._onMouseChangeHandler
|
||||
);
|
||||
this.props.dispatcher.on('kON_CLICK', this._onChildClick);
|
||||
this.props.dispatcher.on('kON_MDOWN', this._onChildMouseDown);
|
||||
|
||||
this.dimensionsCache_ = {};
|
||||
this.hoverKey_ = null;
|
||||
@ -64,6 +57,16 @@ export default class GoogleMapMarkers extends Component {
|
||||
this.state = { ...this._getState(), hoverKey: null };
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
this.props.dispatcher.on('kON_CHANGE', this._onChangeHandler);
|
||||
this.props.dispatcher.on(
|
||||
'kON_MOUSE_POSITION_CHANGE',
|
||||
this._onMouseChangeHandler
|
||||
);
|
||||
this.props.dispatcher.on('kON_CLICK', this._onChildClick);
|
||||
this.props.dispatcher.on('kON_MDOWN', this._onChildMouseDown);
|
||||
}
|
||||
|
||||
shouldComponentUpdate(nextProps, nextState) {
|
||||
if (this.props.experimental === true) {
|
||||
return (
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user