{"id":16089668,"url":"https://github.com/leonelgalan/turbolinks-react-rails-example","last_synced_at":"2026-05-09T09:53:05.391Z","repository":{"id":145977523,"uuid":"87871247","full_name":"leonelgalan/turbolinks-react-rails-example","owner":"leonelgalan","description":"Example app for reactjs/react-rails#607","archived":false,"fork":false,"pushed_at":"2017-04-11T01:32:23.000Z","size":28,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-11T13:23:10.007Z","etag":null,"topics":["bugreport","rails","react","react-rails"],"latest_commit_sha":null,"homepage":"https://morning-ravine-81180.herokuapp.com/pages/one","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/leonelgalan.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-04-11T00:46:44.000Z","updated_at":"2017-04-11T14:18:29.000Z","dependencies_parsed_at":"2023-05-18T15:03:10.520Z","dependency_job_id":null,"html_url":"https://github.com/leonelgalan/turbolinks-react-rails-example","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leonelgalan%2Fturbolinks-react-rails-example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leonelgalan%2Fturbolinks-react-rails-example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leonelgalan%2Fturbolinks-react-rails-example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leonelgalan%2Fturbolinks-react-rails-example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/leonelgalan","download_url":"https://codeload.github.com/leonelgalan/turbolinks-react-rails-example/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247363779,"owners_count":20927007,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bugreport","rails","react","react-rails"],"created_at":"2024-10-09T14:05:08.599Z","updated_at":"2026-05-09T09:53:00.359Z","avatar_url":"https://github.com/leonelgalan.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# README\n\n## :notebook: Issue #607: turbolinks:before-render for unmounting causes warnings\n\n\u003e Warning: unmountComponentAtNode(): The node you're attempting to unmount was rendered by another copy of React.\n\nhttps://github.com/leonelgalan/turbolinks-react-rails-example/tree/v1,\n\n## Proposed Fix\n\n```\ndocument.addEventListener(\"DOMContentLoaded\", reactOnRailsPageLoaded)\ndocument.addEventListener('turbolinks:render', reactOnRailsPageLoaded)\ndocument.addEventListener('turbolinks:before-render', reactOnRailsPageUnloaded)\n```\n\nhttps://github.com/leonelgalan/turbolinks-react-rails-example/tree/v2\n\n## New Warning\n\nhttps://github.com/leonelgalan/turbolinks-react-rails-example/tree/v3 and https://morning-ravine-81180.herokuapp.com/pages/one\n\n\u003e Warning: setState(...): Can only update a mounted or mounting component. This usually means you called setState() on an unmounted component. This is a no-op. Please check the code for the One component.\n\nWith the help of the `rails server` logs I noticed one was being rendering twice, as soon as I added a `sleep 1` to make the asynchronous request slower, the warning appear, just like it does in my project.\n\nLogs:\n\n```\n\n### VISIT ONE ###\n\nStarted GET \"/pages/one\" for ::1 at 2017-04-10 21:25:45 -0400\nProcessing by PagesController#one as HTML\n  Rendering pages/one.html.erb within layouts/application\n  Rendered pages/one.html.erb within layouts/application (0.4ms)\nCompleted 200 OK in 38ms (Views: 36.2ms | ActiveRecord: 0.0ms)\n\n\nStarted GET \"/pages/three\" for ::1 at 2017-04-10 21:25:45 -0400\nProcessing by PagesController#three as */*\nCompleted 200 OK in 1005ms (Views: 0.2ms | ActiveRecord: 0.0ms)\n\n### VISIT TWO (CLICK ON TWO) ###\n\nStarted GET \"/pages/two\" for ::1 at 2017-04-10 21:25:49 -0400\nProcessing by PagesController#two as HTML\n  Rendering pages/two.html.erb within layouts/application\n  Rendered pages/two.html.erb within layouts/application (0.7ms)\nCompleted 200 OK in 43ms (Views: 41.1ms | ActiveRecord: 0.0ms)\n\n\nStarted GET \"/pages/three\" for ::1 at 2017-04-10 21:25:49 -0400\nProcessing by PagesController#three as */*\nCompleted 200 OK in 1005ms (Views: 0.3ms | ActiveRecord: 0.0ms)\n\n### VISIT ONE (CLICK ON ONE) ###\n\nStarted GET \"/pages/one\" for ::1 at 2017-04-10 21:25:53 -0400\nProcessing by PagesController#one as HTML\nStarted GET \"/pages/three\" for ::1 at 2017-04-10 21:25:53 -0400\n  Rendering pages/one.html.erb within layouts/application\n  Rendered pages/one.html.erb within layouts/application (1.3ms)\nProcessing by PagesController#three as */*\nCompleted 200 OK in 75ms (Views: 72.3ms | ActiveRecord: 0.0ms)\n\n\nStarted GET \"/pages/three\" for ::1 at 2017-04-10 21:25:53 -0400\nProcessing by PagesController#three as */*\nCompleted 200 OK in 1001ms (Views: 0.2ms | ActiveRecord: 0.0ms)\n\n\nCompleted 200 OK in 1005ms (Views: 0.2ms | ActiveRecord: 0.0ms)\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleonelgalan%2Fturbolinks-react-rails-example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fleonelgalan%2Fturbolinks-react-rails-example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleonelgalan%2Fturbolinks-react-rails-example/lists"}