Skip to content

Commit

Permalink
Merge pull request #1135 from calleluks/patch-1
Browse files Browse the repository at this point in the history
Don't unmount components on Turbolinks navigation
  • Loading branch information
BookOfGreg authored Dec 3, 2021
2 parents 7f46d76 + 8a58ca8 commit 69255c8
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions react_ujs/src/events/turbolinks.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,9 @@ module.exports = {
// Turbolinks 5+ got rid of named events (?!)
setup: function(ujs) {
ujs.handleEvent('turbolinks:load', ujs.handleMount);
ujs.handleEvent('turbolinks:before-render', ujs.handleUnmount);
},

teardown: function(ujs) {
ujs.removeEvent('turbolinks:load', ujs.handleMount);
ujs.removeEvent('turbolinks:before-render', ujs.handleUnmount);
},
}

0 comments on commit 69255c8

Please sign in to comment.