react-konva
Advanced tools
Comparing version
@@ -28,3 +28,3 @@ /** | ||
var REACT_VERSION = '16.6.1'; | ||
var REACT_VERSION = '16.6.3'; | ||
@@ -54,3 +54,3 @@ if (React.version !== REACT_VERSION) { | ||
this.props.forwardedRef && this.props.forwardedRef(this._stage); | ||
this._setRef(this._stage); | ||
@@ -63,2 +63,15 @@ applyNodeProps(this._stage, this.props); | ||
Stage.prototype._setRef = function _setRef(value) { | ||
var forwardedRef = this.props.forwardedRef; | ||
if (!forwardedRef) { | ||
return; | ||
} | ||
if (typeof forwardedRef === 'function') { | ||
forwardedRef(value); | ||
} else { | ||
forwardedRef.current = value; | ||
} | ||
}; | ||
Stage.prototype.componentDidUpdate = function componentDidUpdate(prevProps) { | ||
@@ -68,3 +81,3 @@ if (!Konva.isBrowser) { | ||
} | ||
this.props.forwardedRef && this.props.forwardedRef(this._stage); | ||
this._setRef(this._stage); | ||
applyNodeProps(this._stage, this.props, prevProps); | ||
@@ -79,3 +92,3 @@ | ||
} | ||
this.props.forwardedRef && this.props.forwardedRef(null); | ||
this._setRef(null); | ||
KonvaRenderer.updateContainer(null, this._mountNode, this); | ||
@@ -82,0 +95,0 @@ this._stage.destroy(); |
@@ -5,3 +5,3 @@ { | ||
"description": "React binding to canvas element via Konva framework", | ||
"version": "16.6.11", | ||
"version": "16.6.31", | ||
"keywords": [ | ||
@@ -21,9 +21,9 @@ "react", | ||
"dependencies": { | ||
"react-reconciler": "^0.17.0", | ||
"scheduler": "^0.11.0" | ||
"react-reconciler": "^0.17.2", | ||
"scheduler": "^0.11.2" | ||
}, | ||
"peerDependencies": { | ||
"react": "16.6.1", | ||
"react-dom": "16.6.1", | ||
"konva": "^2.5.0" | ||
"react": "16.6.3", | ||
"react-dom": "16.6.3", | ||
"konva": "^2.5.1" | ||
}, | ||
@@ -33,8 +33,8 @@ "devDependencies": { | ||
"enzyme": "^3.7.0", | ||
"enzyme-adapter-react-16": "^1.6.0", | ||
"konva": "^2.5.0", | ||
"enzyme-adapter-react-16": "^1.7.0", | ||
"konva": "^2.5.1", | ||
"sinon": "^7.1.1", | ||
"nwb": "^0.23.0", | ||
"react": "16.6.1", | ||
"react-dom": "16.6.1" | ||
"react": "16.6.3", | ||
"react-dom": "16.6.3" | ||
}, | ||
@@ -41,0 +41,0 @@ "scripts": { |
34431
0.49%672
1.66%+ Added
+ Added
- Removed
- Removed
Updated
Updated