Skip to content

Add support for React 0.14 #7

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
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
3 changes: 2 additions & 1 deletion index.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 evaluate = require('eval');

// src can be either a filename or a chunk name
Expand All @@ -22,7 +23,7 @@ ReactToHtmlWebpackPlugin.prototype.apply = function(compiler) {
var source = asset.source();
var Component = evaluate(source, /* filename: */ undefined, /* scope: */ undefined, /* includeGlobals: */ true);
var renderMethod = this.options.static ? 'renderToStaticMarkup' : 'renderToString';
var html = React[renderMethod](React.createElement(Component));
var html = ReactDOMServer[renderMethod](React.createElement(Component.default));

var template = this.options.template;

Expand Down
7 changes: 3 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,8 @@
},
"homepage": "https://github.com/markdalgleish/react-to-html-webpack-plugin",
"dependencies": {
"eval": "^0.1.0"
},
"peerDependencies": {
"react": "0.12.x || >=0.13.0-beta.1"
"eval": "^0.1.0",
"react": "^0.14.2",
"react-dom": "^0.14.2"
}
}