Skip to content

Uncaught ReferenceError: ReactDOM is not defined #371

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

Closed
IvRRimum opened this issue Oct 14, 2015 · 11 comments
Closed

Uncaught ReferenceError: ReactDOM is not defined #371

IvRRimum opened this issue Oct 14, 2015 · 11 comments

Comments

@IvRRimum
Copy link

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

@IvRRimum
Copy link
Author

http://stackoverflow.com/questions/33125669/uncaught-referenceerror-reactdom-is-not-defined

O_o Why arent't the newest version of React on master ?

@42ae
Copy link

42ae commented Oct 15, 2015

@rmosolgo
Copy link
Member

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: #365

I'm on the road this week so I haven't had a chance to find a new way yet!

@rmosolgo
Copy link
Member

Please try gem version 1.4.0 which includes React 0.14 and open an issue if you have any trouble!

@kukula
Copy link

kukula commented Mar 28, 2017

Have the same error on fresh install. react-rails (1.10.0)
Could please anyone help?

@kukula
Copy link

kukula commented Mar 28, 2017

thanks for fast reply! so I can not use react_component view helper?

@IvRRimum
Copy link
Author

You can. Go trough the answers on the stackoverflow question i posted. Loads of discussion and solutions there.

@kukula
Copy link

kukula commented Mar 28, 2017

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.

@IvRRimum
Copy link
Author

@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!

@kukula
Copy link

kukula commented Mar 28, 2017

thank you, I'll create a new issue than.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants