File tree 3 files changed +114
-111
lines changed
3 files changed +114
-111
lines changed Original file line number Diff line number Diff line change @@ -321,7 +321,7 @@ var ReactRailsUJS = {
321
321
}
322
322
throw new Error ( message + ". Make sure your component is available to render." )
323
323
} else {
324
- let component = this . components [ cacheId ] ;
324
+ var component = this . components [ cacheId ] ;
325
325
if ( component === undefined ) {
326
326
component = React . createElement ( constructor , props ) ;
327
327
if ( turbolinksPermanent ) {
@@ -440,12 +440,12 @@ module.exports = {
440
440
// Turbolinks 5+ got rid of named events (?!)
441
441
setup : function ( ujs ) {
442
442
ujs . handleEvent ( 'turbolinks:load' , ujs . handleMount ) ;
443
- ujs . handleEvent ( 'turbolinks:before-render' , ujs . handleMount ) ;
443
+ ujs . handleEvent ( 'turbolinks:before-render' , ujs . handleUnmount ) ;
444
444
} ,
445
445
446
446
teardown : function ( ujs ) {
447
447
ujs . removeEvent ( 'turbolinks:load' , ujs . handleMount ) ;
448
- ujs . removeEvent ( 'turbolinks:before-render' , ujs . handleMount ) ;
448
+ ujs . removeEvent ( 'turbolinks:before-render' , ujs . handleUnmount ) ;
449
449
} ,
450
450
}
451
451
Original file line number Diff line number Diff line change @@ -321,7 +321,7 @@ var ReactRailsUJS = {
321
321
}
322
322
throw new Error ( message + ". Make sure your component is available to render." )
323
323
} else {
324
- let component = this . components [ cacheId ] ;
324
+ var component = this . components [ cacheId ] ;
325
325
if ( component === undefined ) {
326
326
component = React . createElement ( constructor , props ) ;
327
327
if ( turbolinksPermanent ) {
@@ -440,12 +440,12 @@ module.exports = {
440
440
// Turbolinks 5+ got rid of named events (?!)
441
441
setup : function ( ujs ) {
442
442
ujs . handleEvent ( 'turbolinks:load' , ujs . handleMount ) ;
443
- ujs . handleEvent ( 'turbolinks:before-render' , ujs . handleMount ) ;
443
+ ujs . handleEvent ( 'turbolinks:before-render' , ujs . handleUnmount ) ;
444
444
} ,
445
445
446
446
teardown : function ( ujs ) {
447
447
ujs . removeEvent ( 'turbolinks:load' , ujs . handleMount ) ;
448
- ujs . removeEvent ( 'turbolinks:before-render' , ujs . handleMount ) ;
448
+ ujs . removeEvent ( 'turbolinks:before-render' , ujs . handleUnmount ) ;
449
449
} ,
450
450
}
451
451
You can’t perform that action at this time.
0 commit comments