File tree Expand file tree Collapse file tree 1 file changed +18
-1
lines changed
packages/router/src/experimental Expand file tree Collapse file tree 1 file changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -568,6 +568,17 @@ export interface EXPERIMENTAL_Router
568568 * Original options object passed to create the Router
569569 */
570570 readonly options : EXPERIMENTAL_RouterOptions
571+
572+ /**
573+ * Dev only method to replace the resolver used by the router. Used during HMR
574+ *
575+ * @param newResolver - new resolver to use
576+ *
577+ * @internal
578+ */
579+ _hmrReplaceResolver ?: (
580+ newResolver : EXPERIMENTAL_ResolverFixed < EXPERIMENTAL_RouteRecordNormalized_Matchable >
581+ ) => void
571582}
572583
573584/**
@@ -581,7 +592,7 @@ export interface EXPERIMENTAL_Router
581592export function experimental_createRouter (
582593 options : EXPERIMENTAL_RouterOptions
583594) : EXPERIMENTAL_Router {
584- const {
595+ let {
585596 resolver,
586597 // TODO: document that a custom parsing can be handled with a custom param that parses the whole query
587598 // and adds a $query property to the params added at the root record, parent of all records
@@ -1373,6 +1384,12 @@ export function experimental_createRouter(
13731384 )
13741385 }
13751386
1387+ if ( __DEV__ ) {
1388+ router . _hmrReplaceResolver = newResolver => {
1389+ resolver = newResolver
1390+ }
1391+ }
1392+
13761393 return router
13771394}
13781395
You can’t perform that action at this time.
0 commit comments