diff --git a/package.json b/package.json index 6cf48ab..e2d3c07 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "react-mirror", - "version": "0.4.0", + "version": "0.4.1", "description": "Takes control of component's rendering cycle allowing many synchronized replicas of it's DOM", "repository": { "type": "git", diff --git a/src/replicator.js b/src/replicator.js index 3661d7e..10fd9ec 100644 --- a/src/replicator.js +++ b/src/replicator.js @@ -120,7 +120,7 @@ class Replicator extends Component { !this._ghost && (this._ghost = document.createElement('div')) this._master.parentNode.appendChild(this._ghost) this._ghost.appendChild(this._imprint) - React.render(this._element, this._imprint) + React.unstable_renderSubtreeIntoContainer(this, this._element, this._imprint) this._master.parentNode.removeChild(this._ghost) this._master.appendChild(this._ghost.firstChild) @@ -132,13 +132,13 @@ class Replicator extends Component { (mirror.style.pointerEvents = 'none') )) } else if (this._keepInSync) { - React.render(this._element, this._imprint) + React.unstable_renderSubtreeIntoContainer(this, this._element, this._imprint) } this.observe(true) } getDOMNode (sync) { - return ((sync || (sync == null && !this._imprint.children.length)) && React.render(this._element, this._imprint), this._imprint) + return ((sync || (sync == null && !this._imprint.children.length)) && React.unstable_renderSubtreeIntoContainer(this, this._element, this._imprint), this._imprint) } }