Skip to content

Commit

Permalink
Merge pull request #81 from Syncano/react-0.14
Browse files Browse the repository at this point in the history
Add support for react 0.14
  • Loading branch information
KyleAMathews committed Nov 21, 2015
2 parents 17cf279 + 809f17c commit 018fccf
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 8 deletions.
3 changes: 2 additions & 1 deletion lib/utils/serve.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ require('node-cjsx').transform();
var Hapi = require('hapi');
var Boom = require('boom');
var React = require('react');
var ReactDOMServer = require('react-dom/server');
var Router = require('react-router');
var path = require('path');
var WebpackDevServer = require('webpack-dev-server');
Expand Down Expand Up @@ -69,7 +70,7 @@ module.exports = function(program) {
return reply(Boom.notFound());
}

var html = React.renderToStaticMarkup(React.createElement(HTML));
var html = ReactDOMServer.renderToStaticMarkup(React.createElement(HTML));
html = "<!DOCTYPE html>\n" + html;
return reply(html);
}
Expand Down
5 changes: 3 additions & 2 deletions lib/utils/static-entry.jsx
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 Router = require('react-router');
var find = require('lodash/collection/find');
var filter = require('lodash/collection/filter');
Expand Down Expand Up @@ -41,7 +42,7 @@ module.exports = function(locals, callback) {
body = "";
html = "";
try {
body = React.renderToString(
body = ReactDOMServer.renderToString(
<Handler
config={config}
pages={pages}
Expand All @@ -50,7 +51,7 @@ module.exports = function(locals, callback) {
state={state}
/>
);
html = "<!DOCTYPE html>\n" + React.renderToStaticMarkup(
html = "<!DOCTYPE html>\n" + ReactDOMServer.renderToStaticMarkup(
<HTML
config={config}
page={page}
Expand Down
3 changes: 2 additions & 1 deletion lib/utils/web-entry.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
var React = require('react');
var ReactDOM = require('react-dom');
var Router = require('react-router');
var find = require('lodash/collection/find');
var filter = require('lodash/collection/filter');
Expand Down Expand Up @@ -44,7 +45,7 @@ loadConfig(function() {
if (app.onRouteChange) {
app.onRouteChange(state, page, pages, config);
}
return React.render(
return ReactDOM.render(
<Handler
config={config}
pages={pages}
Expand Down
9 changes: 5 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"coffee-loader": "^0.7.2",
"coffee-script": "^1.9.3",
"commander": "^2.8.1",
"css-loader": "^0.19.0",
"css-loader": "^0.22.0",
"front-matter": "^1.0.0",
"fs-extra": "^0.19.0",
"glob": "^5.0.7",
Expand All @@ -41,10 +41,11 @@
"null-loader": "^0.1.1",
"parse-filepath": "^0.5.0",
"raw-loader": "^0.5.1",
"react": "^0.13.3",
"react-document-title": "^1.0.2",
"react": "^0.14.2",
"react-dom": "^0.14.2",
"react-document-title": "^2.0.1",
"react-hot-loader": "^1.2.7",
"react-router": "^0.13.3",
"react-router": "^0.13.5",
"rimraf": "^2.4.2",
"static-site-generator-webpack-plugin": "^1.0.0",
"style-loader": "^0.13.0",
Expand Down

0 comments on commit 018fccf

Please sign in to comment.