-
-
Notifications
You must be signed in to change notification settings - Fork 629
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
Components aren't unmounted when Turbolinks cache is disabled #629
Comments
@volkanunsal Please keep researching this. Eventually, we might want to create a customized offshoot of turbolinks that can work with react-router and code-splitting by routes. |
#425 fixes for me the 'flickering' of component which is rendered on every page when navigating between pages. |
@szyablitsky @volkanunsal The community will greatly appreciate any research into this matter, and a PR! |
@justin808 I've been meaning to come back to this. I'm going to look into it tomorrow! |
I discovered that |
Maybe we should make this configurable? |
@szyablitsky What version of react are you using? In 15.2.x I get the error discussed in #610 |
Right now we're using react@15.4.1 & react-on-rails@6.2.0 |
Disable Turbolinks cache with a meta tag. That should take care of it.
…On Sun, Dec 11, 2016 at 11:05 PM Sergey Zyablitsky ***@***.***> wrote:
Right now we're using ***@***.*** & ***@***.***
I've seen this error before, and did not know this can be related to
turbolinks. I do not see this error in our application anymore.
Ha-ha. As it turns out ***@***.*** already have merged using
turbolinks:before-cache, despite changelog, which says it was merged only
in 6.2.1. That's why we do not have "The node you're attempting to unmount
was rendered by another copy of React" problem. But we have 'flickering'
components problem again.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#629 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAJQMFkGPnvjSEyMwNuQUOMmqJ6nY4IPks5rHMfxgaJpZM4LAPSY>
.
|
@szyablitsky I mean disable the cache after the latest PR lands. You shouldn't disable it when still using |
@volkanunsal disabling turbolinks cache doesn't solve "flickering" components problem. |
@szyablitsky A possible solution is to use fake content at the mount point. It would look something like the component, and have the same dimensions. |
@volkanunsal thank you for the idea. This can be used as a partial solution. |
I think the best solution is to modify ReactDOM's |
This issue is related to #610. Listening to
turbolinks:before-cache
event results in component not being unmounted when the cache is disabled. I propose usingturbolinks:before-visit
event in addition to it, which would cover all the bases. (However, if both events are fired off consecutively, this approach might cause problems. It's worth investigating further.)The text was updated successfully, but these errors were encountered: