Skip to content
This repository has been archived by the owner on Aug 16, 2021. It is now read-only.

Asynchronous render replaced with synchronous renderToString #226

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 1 addition & 8 deletions src/plugins/react/templates.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,10 @@
'use strict';

var isValidElement = require('react').isValidElement;
var ReactDOM = require('react-dom');
var renderToString = require('react-dom/server').renderToString;

var Selectivity = require('../../selectivity');

var div = null;
function renderToString(element) {
div = div || document.createElement('div');
ReactDOM.render(element, div);
return div.innerHTML;
}

/**
* Overrides the Selectivity template() method to support React templates.
*
Expand Down