File tree Expand file tree Collapse file tree 3 files changed +114
-111
lines changed Expand file tree Collapse file tree 3 files changed +114
-111
lines changed Original file line number Diff line number Diff line change @@ -321,7 +321,7 @@ var ReactRailsUJS = {
321321 }
322322 throw new Error ( message + ". Make sure your component is available to render." )
323323 } else {
324- let component = this . components [ cacheId ] ;
324+ var component = this . components [ cacheId ] ;
325325 if ( component === undefined ) {
326326 component = React . createElement ( constructor , props ) ;
327327 if ( turbolinksPermanent ) {
@@ -440,12 +440,12 @@ module.exports = {
440440 // Turbolinks 5+ got rid of named events (?!)
441441 setup : function ( ujs ) {
442442 ujs . handleEvent ( 'turbolinks:load' , ujs . handleMount ) ;
443- ujs . handleEvent ( 'turbolinks:before-render' , ujs . handleMount ) ;
443+ ujs . handleEvent ( 'turbolinks:before-render' , ujs . handleUnmount ) ;
444444 } ,
445445
446446 teardown : function ( ujs ) {
447447 ujs . removeEvent ( 'turbolinks:load' , ujs . handleMount ) ;
448- ujs . removeEvent ( 'turbolinks:before-render' , ujs . handleMount ) ;
448+ ujs . removeEvent ( 'turbolinks:before-render' , ujs . handleUnmount ) ;
449449 } ,
450450}
451451
Original file line number Diff line number Diff line change @@ -321,7 +321,7 @@ var ReactRailsUJS = {
321321 }
322322 throw new Error ( message + ". Make sure your component is available to render." )
323323 } else {
324- let component = this . components [ cacheId ] ;
324+ var component = this . components [ cacheId ] ;
325325 if ( component === undefined ) {
326326 component = React . createElement ( constructor , props ) ;
327327 if ( turbolinksPermanent ) {
@@ -440,12 +440,12 @@ module.exports = {
440440 // Turbolinks 5+ got rid of named events (?!)
441441 setup : function ( ujs ) {
442442 ujs . handleEvent ( 'turbolinks:load' , ujs . handleMount ) ;
443- ujs . handleEvent ( 'turbolinks:before-render' , ujs . handleMount ) ;
443+ ujs . handleEvent ( 'turbolinks:before-render' , ujs . handleUnmount ) ;
444444 } ,
445445
446446 teardown : function ( ujs ) {
447447 ujs . removeEvent ( 'turbolinks:load' , ujs . handleMount ) ;
448- ujs . removeEvent ( 'turbolinks:before-render' , ujs . handleMount ) ;
448+ ujs . removeEvent ( 'turbolinks:before-render' , ujs . handleUnmount ) ;
449449 } ,
450450}
451451
You can’t perform that action at this time.
0 commit comments