Skip to content
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

ReactDOM undefined with React 16 #803

Closed
1 of 4 tasks
cristianrosu opened this issue Oct 11, 2017 · 3 comments
Closed
1 of 4 tasks

ReactDOM undefined with React 16 #803

cristianrosu opened this issue Oct 11, 2017 · 3 comments

Comments

@cristianrosu
Copy link

cristianrosu commented Oct 11, 2017

Help us help you! Please choose one:

  • My app crashes with react-rails, so I've included the stack trace and the exact steps which make it crash.
  • My app doesn't crash, but I'm getting unexpected behavior. So, I've described the unexpected behavior and suggested a new behavior.
  • I'm trying to use react-rails with another library, but I'm having trouble. I've described my JavaScript management setup (eg, Sprockets, Webpack...), how I'm trying to use this other library, and why it's not working.
  • I have another issue to discuss.

Hey there!
I've been successfully using react-rails but I'm now trying to use the gem with React 16 directly from master. Calling react_component in my views throws an error in react_ujs, more specifically in ReactDOM.render because ReactDOM is undefined.

I've been able to fix this by manually requiring react-dom before react_ujs but this should be handled by the gem.

Anyone else has this issue and maybe ideas how to properly fix it? Thanks ✌️

@BookOfGreg
Copy link
Member

Yep agreed. If possible could you write a failing test? I recently wrote a test in #802 that checked for a JS error within the ruby test suite, if possible could you follow that example? https://github.com/reactjs/react-rails/blob/master/test/react/rails/react_rails_ujs_test.rb#L104-L107

@BookOfGreg
Copy link
Member

Is this related to #747 ?
So far I've been unable to replicate it.

@cristianrosu and @yhkang95 can you provide a failing test or reproduction steps?

@BookOfGreg
Copy link
Member

Closing for now. I'll reopen if I hear back. Thank you.

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

No branches or pull requests

2 participants