@@ -33,16 +33,20 @@ export const reducer = handleActions({
3333// hook
3434export const hookRedux = ( { dispatch, server } ) => ( {
3535 start : ( { path, location, ctx } ) => {
36- dispatch ( start ( { path, location, isTransition : true , ctx . toObject ( ) } ) ) ;
36+ const plainCtx = ctx . toObject ( ) ;
37+ dispatch ( start ( { path, location, isTransition : true , ctx : plainCtx } ) ) ;
3738 } ,
38- resolve : ( { route, status, params, redirect } ) => {
39- server && dispatch ( end ( { route, status, params, redirect, isTransition : false , ctx . toObject ( ) } ) ) ;
39+ resolve : ( { route, status, params, redirect, ctx } ) => {
40+ const plainCtx = ctx . toObject ( ) ;
41+ server && dispatch ( end ( { route, status, params, redirect, isTransition : false , ctx : plainCtx } ) ) ;
4042 } ,
41- render : ( { route, status, params, redirect } ) => {
42- dispatch ( end ( { route, status, params, redirect, isTransition : false , ctx . toObject ( ) } ) ) ;
43+ render : ( { route, status, params, redirect, ctx } ) => {
44+ const plainCtx = ctx . toObject ( ) ;
45+ dispatch ( end ( { route, status, params, redirect, isTransition : false , ctx : plainCtx } ) ) ;
4346 } ,
44- error : ( { error : err } ) => {
45- dispatch ( error ( { err, isTransition : false , ctx . toObject ( ) } ) ) ;
47+ error : ( { error : err , ctx } ) => {
48+ const plainCtx = ctx . toObject ( ) ;
49+ dispatch ( error ( { err, isTransition : false , ctx : plainCtx } ) ) ;
4650 } ,
4751 cancel : ( ) => {
4852 console . warn ( 'router cancel transition' ) ;
0 commit comments