javascript - Using react-router get data via ajax and pass to next route -


i have auth page, when click submit button data via ajax,then transition , pass data next route login.coffee

handlecommit: (event) ->     event.preventdefault()     $.ajax({          dosomething...      })     .done (data) ->         this.transitionto 'dashboard',{data:data} 

but transitonto can't use in async block.so try fix it

handlecommit: (event) ->     event.preventdefault()     this.transitionto 'dashboard'  willtransitionfrom: (transition, component, callback) ->     $.ajax({          dosomthing...      })     .done (data) ->         # transition.redirect('dashboard', null, {data:data})         callback() 

the part 1, problem this.transitionto can't use in async block. part 2, looks fine, via willtransitionfrom hook can data via ajax , transition path. but, aim pass data path too, transition.redirect dosen't work.

how can data via async function, correct redirect , pass it?

thanks reply


Comments

Popular posts from this blog

apache - PHP Soap issue while content length is larger -

asynchronous - Python asyncio task got bad yield -

javascript - Complete OpenIDConnect auth when requesting via Ajax -