Skip to content

Commit

Permalink
Update root container attributes on client transition with reuseDom
Browse files Browse the repository at this point in the history
Fixes #73.
  • Loading branch information
gigabo committed May 25, 2016
1 parent 2ad4497 commit 9ea54a8
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions packages/react-server/core/ClientController.js
Original file line number Diff line number Diff line change
Expand Up @@ -577,6 +577,10 @@ class ClientController extends EventEmitter {
//
if (this._reuseDom && element.containerOpen && oldRootContainer) {
mountNode = oldRootContainer;
this._updateContainerNodeAttributes(
mountNode,
element.containerOpen
);
} else if (this._reuseDom && element.containerClose && !oldRootContainer && !oldRootElement) {
mountNode = mountNode.parentNode;
} else if (this._reuseDom && oldRootElement) {
Expand Down Expand Up @@ -737,6 +741,10 @@ class ClientController extends EventEmitter {
return node;
}

_updateContainerNodeAttributes(node, attrs) {
_.forEach(attrs, (v, k) => node.setAttribute(k, v));
}

init () {

var unloadHandler = () => {this.terminate(); };
Expand Down

0 comments on commit 9ea54a8

Please sign in to comment.