Skip to content

Rails 4 to 5 upgrade #747

Closed
Closed
@yhkang95

Description

@yhkang95

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.

Hi,

I was using react-rails fine with Rails 4, but it stopped working when I updated to Rails 5.

If I do <%= react_component('New') %>, I only get the below output and not the actual content.

<div data-react-class="New" data-react-props="{}"></div>

To figure out if it had any conflicts with other gems, I even created a new Rails 5 project. Still the same issue.

Below is the log I get in the console.

Uncaught TypeError: Cannot read property 'render' of undefined
    at Object.mountComponents (react_ujs.self-d595485….js?body=1:318)
    at HTMLDocument.ReactRailsUJS.handleMount (react_ujs.self-d595485….js?body=1:349)
    at HTMLDocument.dispatch (jquery.self-bd7ddd3….js?body=1:5227)
    at HTMLDocument.elemData.handle (jquery.self-bd7ddd3….js?body=1:4879)

Any help would be appreciated.

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions