Skip to content
Merged
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
10 changes: 4 additions & 6 deletions src/browser/server/ReactServerRendering.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@ var invariant = require('invariant');
* @param {?object} context
* @return {string} the HTML markup
*/
function renderToString(element, context) {
if(context === undefined) context = emptyObject;
function renderToString(element) {
invariant(
ReactElement.isValidElement(element),
'renderToString(): You must pass a valid ReactElement.'
Expand All @@ -40,7 +39,7 @@ function renderToString(element, context) {

return transaction.perform(function() {
var componentInstance = instantiateReactComponent(element, null);
var markup = componentInstance.mountComponent(id, transaction, context);
var markup = componentInstance.mountComponent(id, transaction, emptyObject);
return ReactMarkupChecksum.addChecksumToMarkup(markup);
}, null);
} finally {
Expand All @@ -54,8 +53,7 @@ function renderToString(element, context) {
* @return {string} the HTML markup, without the extra React ID and checksum
* (for generating static pages)
*/
function renderToStaticMarkup(element, context) {
if(context === undefined) context = emptyObject;
function renderToStaticMarkup(element) {
invariant(
ReactElement.isValidElement(element),
'renderToStaticMarkup(): You must pass a valid ReactElement.'
Expand All @@ -68,7 +66,7 @@ function renderToStaticMarkup(element, context) {

return transaction.perform(function() {
var componentInstance = instantiateReactComponent(element, null);
return componentInstance.mountComponent(id, transaction, context);
return componentInstance.mountComponent(id, transaction, emptyObject);
}, null);
} finally {
ReactServerRenderingTransaction.release(transaction);
Expand Down