How to: Stop listening to events - reactjs/react-rails GitHub Wiki
Based on discussion here: #805
If you want to stop listening to a specified event, it's possible to name the events to stop listening to.
ReactRailsUJS.removeEvent('turbolinks:render', ReactRailsUJS.handleMount);
ReactRailsUJS.removeEvent('DOMContentLoaded', ReactRailsUJS.handleMount);
$(window).on('load', function() {
ReactRailsUJS.handleMount();
ReactRailsUJS.detectEvents();
})
Thanks @anaumov