Skip to content

Commit ecfdc52

Browse files
David Obritermosolgo
David Obrite
authored andcommitted
fix(JS): unmount components during 'turbolinks:before-render' for Turbolinks 5
1 parent 4cba7d8 commit ecfdc52

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/assets/javascripts/react_ujs_turbolinks.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// Turbolinks 5+ got rid of named events (?!)
44
setup: function() {
55
ReactRailsUJS.handleEvent('turbolinks:load', function() {window.ReactRailsUJS.mountComponents()});
6-
ReactRailsUJS.handleEvent('turbolinks:before-cache', function() {window.ReactRailsUJS.unmountComponents()});
6+
ReactRailsUJS.handleEvent('turbolinks:before-render', function() {window.ReactRailsUJS.unmountComponents()});
77
}
88
};
99
})(document, window);

0 commit comments

Comments
 (0)