Skip to content

React Rails + Turbolinks not working correctly on initial page load #767

@edwardmp

Description

@edwardmp
  • 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've used this gem for a while now and it's great. However, these last few months I've ran into an issue I can't really explain.

What I noticed at some point is that the React state somehow isn't loaded correctly by the components that are mounted. The odd thing is that this only happens when this page is the first page I load. So If open a new browser window, load this page, then the issue would occur. If I then navigate to another page on my site and navigate back to the problematic page everything works fine.

I managed to track this issue down to occurring since v2 of this gem. I resorted back to the last v1 version of this gem (1.11.0) and this issue doesn't display there. When I upgrade to v2.1.0 then I encounter this issue, 2.2.1 also displays the issue. I am not able to test against any earlier v2 versions since I use Rails 5.1.

I suspect this might have something to do with Turbolinks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions