* Original options object passed to create the Router
*/
readonly options: EXPERIMENTAL_RouterOptions
+
+ /**
+ * Dev only method to replace the resolver used by the router. Used during HMR
+ *
+ * @param newResolver - new resolver to use
+ *
+ * @internal
+ */
+ _hmrReplaceResolver?: (
+ newResolver: EXPERIMENTAL_ResolverFixed<EXPERIMENTAL_RouteRecordNormalized_Matchable>
+ ) => void
}
/**
export function experimental_createRouter(
options: EXPERIMENTAL_RouterOptions
): EXPERIMENTAL_Router {
- const {
+ let {
resolver,
// TODO: document that a custom parsing can be handled with a custom param that parses the whole query
// and adds a $query property to the params added at the root record, parent of all records
)
}
+ if (__DEV__) {
+ router._hmrReplaceResolver = newResolver => {
+ resolver = newResolver
+ }
+ }
+
return router
}