Skip to content

Commit

Permalink
fix: #51
Browse files Browse the repository at this point in the history
  • Loading branch information
JserWang committed Aug 19, 2018
1 parent ae5e563 commit 84b97de
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 2 deletions.
3 changes: 3 additions & 0 deletions lib/components/Control/BaseControl.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ var _createClass = function () { function defineProperties(target, props) { for

var _reactDom = require('react-dom');

var _util = require('../_base/util');

function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }

var BaseControl = function () {
Expand All @@ -25,6 +27,7 @@ var BaseControl = function () {
key: 'onPropsUpdate',
value: function onPropsUpdate(newProps) {
this.props = newProps;
(0, _util.unBindEvents)(this.instance);
this.destroy();
this.init();
}
Expand Down
3 changes: 3 additions & 0 deletions lib/components/Overlay/BaseOverlay.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ var _createClass = function () { function defineProperties(target, props) { for

var _reactDom = require('react-dom');

var _util = require('../_base/util');

function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }

var BaseOverlay = function () {
Expand All @@ -34,6 +36,7 @@ var BaseOverlay = function () {
key: 'onPropsUpdate',
value: function onPropsUpdate(newProps) {
this.props = newProps;
(0, _util.unBindEvents)(this.instance);
this.destroy();
this.init();
}
Expand Down
2 changes: 1 addition & 1 deletion lib/components/_base/options.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Object.defineProperty(exports, "__esModule", {
value: true
});
var MAP_SET_OPTIONS = exports.MAP_SET_OPTIONS = ['minZoom', 'maxZoom', 'defaultCursor', 'draggingCursor', 'mapStyle', 'mapType', 'zoom'];
var MAP_SET_OPTIONS = exports.MAP_SET_OPTIONS = ['minZoom', 'maxZoom', 'defaultCursor', 'draggingCursor', 'mapStyle', 'zoom'];

var MAP_BOOLEAN_OPTIONS = exports.MAP_BOOLEAN_OPTIONS = ['dragging', 'scrollWheelZoom', 'doubleClickZoom', 'keyboard', 'inertialDragging', 'continuousZoom', 'pinchToZoom', 'autoResize'];

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "rc-bmap",
"version": "0.1.9",
"version": "0.2.0",
"main": "lib/index.js",
"typings": "types/index.d.ts",
"repository": {
Expand Down
2 changes: 2 additions & 0 deletions src/components/Control/BaseControl.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@

import { render as reactRender } from 'react-dom';
import { unBindEvents } from '../_base/util';

class BaseControl {
constructor(props) {
Expand All @@ -12,6 +13,7 @@ class BaseControl {

onPropsUpdate(newProps) {
this.props = newProps;
unBindEvents(this.instance);
this.destroy();
this.init();
}
Expand Down
2 changes: 2 additions & 0 deletions src/components/Overlay/BaseOverlay.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@

import { render as reactRender } from 'react-dom';
import { unBindEvents } from '../_base/util';

class BaseOverlay {
constructor(props) {
Expand All @@ -20,6 +21,7 @@ class BaseOverlay {

onPropsUpdate(newProps) {
this.props = newProps;
unBindEvents(this.instance);
this.destroy();
this.init();
}
Expand Down

0 comments on commit 84b97de

Please sign in to comment.