Skip to content

Commit

Permalink
Merge pull request markfinger#4 from Ppjet6/react-0.14
Browse files Browse the repository at this point in the history
Require react-dom/server for renderTo* functions
  • Loading branch information
markfinger committed Nov 5, 2015
2 parents e0425f0 + 60e7b62 commit fbc9ce0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
7 changes: 5 additions & 2 deletions lib/Component.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
var React = require('react');
var ReactDOMServer = require('react-dom/server');
var path = require('path');

var Component = function Component(opts) {
Expand Down Expand Up @@ -69,8 +70,10 @@ Component.prototype._render = function _render(props, toStaticMarkup, cb) {
if (err) return cb(err);

var render = (
toStaticMarkup ? React.renderToStaticMarkup : React.renderToString
).bind(React);
toStaticMarkup
? ReactDOMServer.renderToStaticMarkup
: ReactDOMServer.renderToString
).bind(ReactDOMServer);

try {
var markup = render(factory(props));
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@
"devDependencies": {
"chai": "^3.0.0",
"mocha": "^2.2.5",
"react": "^0.13.3"
"react": "^0.14.2",
"react-dom": "^0.14.2"
},
"scripts": {
"test": "mocha"
Expand Down

0 comments on commit fbc9ce0

Please sign in to comment.