Uncaught ReferenceError: ReactDOM is not defined
Freshly installed, when i tryed to run hello world program, this error hapened: Uncaught ReferenceError: ReactDOM is not defined
This is my react:
var HelloWorld = React.createClass({
render: function() {
return (
<p>
Hello, <input type="text" placeholder="Your name here" />!
It is {this.props.date.toTimeString()}
</p>
);
}
});
setInterval(function() {
ReactDOM.render(
<HelloWorld date={new Date()} />,
document.getElementById('example')
);
}, 500);
Its saved inside /app/assets/javascripts/components/test.js.jsx file.
Rails 4.2.4 With Ruby 2.2.3
http://stackoverflow.com/questions/33125669/uncaught-referenceerror-reactdom-is-not-defined
O_o Why arent't the newest version of React on master ?
It's actually already on master: https://github.com/reactjs/react-rails/blob/master/lib/assets/javascripts/react_ujs.js.erb#L57
The change from a single JS package to many modules has complicated the process for building React.js into the gem code, see full discussion here: https://github.com/reactjs/react-rails/pull/365
I'm on the road this week so I haven't had a chance to find a new way yet!
Please try gem version 1.4.0 which includes React 0.14 and open an issue if you have any trouble!
Have the same error on fresh install. react-rails (1.10.0) Could please anyone help?
@kukula http://stackoverflow.com/questions/33125669/uncaught-referenceerror-reactdom-is-not-defined
thanks for fast reply! so I can not use react_component view helper?
You can. Go trough the answers on the stackoverflow question i posted. Loads of discussion and solutions there.
I've checked answers, but I'm not calling ReactDOM.render, I'm using react_component view helper in my view. Question is not about React itself, question about this gem.
@kukula Then you are asking at the wrong issue i guess. In this issue we discuss the problem with ReactDOM.render. Wish the best of luck to you!
thank you, I'll create a new issue than.