Removed context paremeter to renderToString/renderToStaticMarkup.
Jim committed
Nov 18, 2014 at 22:45 UTC
7768d91363cfc6caef6256ef154885058c3d7f37
1 file changed
+4
-6
src/browser/server/ReactServerRendering.js
+4
-6
@@ -26,8 +26,7 @@ var invariant = require('invariant');
26
* @param {?object} context
27
* @return {string} the HTML markup
28
*/
29
-function renderToString(element, context) {
30
- if(context === undefined) context = emptyObject;
29
+function renderToString(element) {
30
invariant(
31
ReactElement.isValidElement(element),
32
'renderToString(): You must pass a valid ReactElement.'
@@ -40,7 +39,7 @@ function renderToString(element, context) {
39
40
return transaction.perform(function() {
41
var componentInstance = instantiateReactComponent(element, null);
43
- var markup = componentInstance.mountComponent(id, transaction, context);
42
+ var markup = componentInstance.mountComponent(id, transaction, emptyObject);
43
return ReactMarkupChecksum.addChecksumToMarkup(markup);
44
}, null);
45
} finally {
@@ -54,8 +53,7 @@ function renderToString(element, context) {
53
* @return {string} the HTML markup, without the extra React ID and checksum
54
* (for generating static pages)
55
*/
57
-function renderToStaticMarkup(element, context) {
58
- if(context === undefined) context = emptyObject;
56
+function renderToStaticMarkup(element) {
57
invariant(
58
ReactElement.isValidElement(element),
59
'renderToStaticMarkup(): You must pass a valid ReactElement.'
@@ -68,7 +66,7 @@ function renderToStaticMarkup(element, context) {
66
67
return transaction.perform(function() {
68
var componentInstance = instantiateReactComponent(element, null);
71
- return componentInstance.mountComponent(id, transaction, context);
69
+ return componentInstance.mountComponent(id, transaction, emptyObject);
70
}, null);
71
} finally {
72
ReactServerRenderingTransaction.release(transaction);