rmosolgo / react-rails-hot-loader

Live-reload React.js components with Ruby on Rails & react-rails
MIT License
88 stars 26 forks source link

Hot Reloading doesn't work if we have any statement before actual react component. #10

Open akshaymohite opened 8 years ago

akshaymohite commented 8 years ago

If we use strict mode as the first statement (or any other statement for that matter) then js code evals the first statement and thus, hot reloading doesn't work.

For example,

'use strict';

const Header = React.createClass({

  render() {
    return (
        <h1>Header Text</h1>
    );
  }
})
rmosolgo commented 8 years ago

Hmmm.... I wonder where it's breaking down. It seems like eval should support multiple statements. And the code flow is simple:

Is there any error in the JS console? Or it just fails silently?