Skip to content

Removed context paremeter to renderToString/renderToStaticMarkup. #2565

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 19, 2014
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