Skip to content

Commit

Permalink
Merge pull request #266 from Robert-Frampton/iso_metal-incremental-dom
Browse files Browse the repository at this point in the history
Prevents parent creation on patch when running in Node.js
  • Loading branch information
jbalsas authored Oct 11, 2017
2 parents b8e1755 + c2a316d commit 7d08bc2
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/metal-incremental-dom/src/render/patch.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import { append, exitDocument } from 'metal-dom';
import { getData } from '../data';
import { isServerSide } from 'metal';
import { render } from './render';

const patchingComponents_ = [];
Expand All @@ -15,7 +16,10 @@ const patchingComponents_ = [];
*/
function buildParentIfNecessary_(element) {
if (!element || !element.parentNode) {
const parent = document.createElement('div');
let parent = {};
if (!isServerSide()) {
parent = document.createElement('div');
}
if (element) {
append(parent, element);
}
Expand Down

0 comments on commit 7d08bc2

Please sign in to comment.