Skip to content

Commit 579a91a

Browse files
author
Robert Mosolgo
committed
Merge pull request #93 from felixbuenemann/react_ujs-turbolinks-eventhandler-fix
Only use turbolinks events if supported
2 parents 201edce + eb75249 commit 579a91a

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lib/assets/javascripts/react_ujs.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,5 +61,9 @@
6161
}
6262
};
6363

64-
typeof Turbolinks !== 'undefined' ? handleTurbolinksEvents() : handleNativeEvents();
64+
if (typeof Turbolinks !== 'undefined' && Turbolinks.supported) {
65+
handleTurbolinksEvents();
66+
} else {
67+
handleNativeEvents();
68+
}
6569
})(document, window, React);

0 commit comments

Comments
 (0)