File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -340,6 +340,15 @@ export function wrapCreateBrowserRouter<
340340 TState extends RouterState = RouterState ,
341341 TRouter extends Router < TState > = Router < TState > ,
342342> ( createRouterFunction : CreateRouterFunction < TState , TRouter > ) : CreateRouterFunction < TState , TRouter > {
343+ if ( ! _useEffect || ! _useLocation || ! _useNavigationType || ! _matchRoutes ) {
344+ DEBUG_BUILD &&
345+ logger . warn (
346+ 'reactRouterV6Instrumentation was unable to wrap the `createRouter` function because of one or more missing parameters.' ,
347+ ) ;
348+
349+ return createRouterFunction ;
350+ }
351+
343352 // `opts` for createBrowserHistory and createMemoryHistory are different, but also not relevant for us at the moment.
344353 // `basename` is the only option that is relevant for us, and it is the same for all.
345354 // eslint-disable-next-line @typescript-eslint/no-explicit-any
You can’t perform that action at this time.
0 commit comments