Skip to content

Commit

Permalink
Use more precise React.createClass call regex to avoid matching own code
Browse files Browse the repository at this point in the history
  • Loading branch information
gaearon committed Aug 23, 2014
1 parent 4e863f5 commit f71c678
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ module.exports = function (source) {
var matches = 0,
processedSource;

processedSource = source.replace(/React\.createClass/g, function (match) {
processedSource = source.replace(/React\.createClass\s*\(\s*\{/g, function (match) {
matches++;
return '__hotUpdateAPI.createClass';
return '__hotUpdateAPI.createClass({';
});

if (!matches) {
Expand Down

0 comments on commit f71c678

Please sign in to comment.