File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
packages/reactant-share/src Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -59,7 +59,7 @@ class ReactantRouter extends BaseReactantRouter {
5959 } ) ;
6060
6161 if ( ! this . portDetector . shared ) {
62- this . watchRehydratedRouting ( ) ;
62+ const stopWatching = this . watchRehydratedRouting ( ) ;
6363 watch (
6464 this ,
6565 ( ) => this . router ,
@@ -68,6 +68,9 @@ class ReactantRouter extends BaseReactantRouter {
6868 // just update the current router to routers mapping by name
6969 this . _setRouters ( this . portDetector . name , this . router ) ;
7070 }
71+ if ( ! this . enableCacheRouting ) {
72+ stopWatching ( ) ;
73+ }
7174 }
7275 ) ;
7376 }
@@ -102,7 +105,7 @@ class ReactantRouter extends BaseReactantRouter {
102105 }
103106 } ) ;
104107 } else if ( this . enableCacheRouting ) {
105- this . watchRehydratedRouting ( ) ;
108+ return this . watchRehydratedRouting ( ) ;
106109 }
107110 } ) ;
108111 this . portDetector . onClient ( ( transport ) => {
@@ -200,6 +203,7 @@ class ReactantRouter extends BaseReactantRouter {
200203 }
201204 }
202205 ) ;
206+ return stopWatching ;
203207 }
204208
205209 protected _changeRoutingOnSever ( name : string , router : RouterState ) {
You can’t perform that action at this time.
0 commit comments