Skip to content

Commit b1ee8ef

Browse files
committed
check for turbolinks classic before teardown
1 parent 6642ae0 commit b1ee8ef

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

react_ujs/src/events/detect.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@ var turbolinksClassicEvents = require("./turbolinksClassic")
99
module.exports = function(ujs) {
1010
if (ujs.handleEvent) {
1111
// We're calling this a second time -- remove previous handlers
12-
turbolinksClassicEvents.teardown(ujs)
12+
if (typeof Turbolinks.EVENTS !== "undefined") {
13+
turbolinksClassicEvents.teardown(ujs);
14+
}
1315
turbolinksEvents.teardown(ujs);
1416
turbolinksClassicDeprecatedEvents.teardown(ujs);
1517
pjaxEvents.teardown(ujs);

0 commit comments

Comments
 (0)