diff --git a/src/controllers/router/index.tsx b/src/controllers/router/index.tsx index 0545cba6..4ed90e3a 100644 --- a/src/controllers/router/index.tsx +++ b/src/controllers/router/index.tsx @@ -22,7 +22,7 @@ export const Router = ({ initialRoute={initialRoute} isGlobal={isGlobal} onPrefetch={onPrefetch} - plugins={plugins} + plugins={plugins ?? []} routes={routes} > {children} @@ -44,7 +44,7 @@ export function MemoryRouter(props: MemoryRouterProps) { {...props} history={history} isGlobal={false} - plugins={props.plugins || []} + plugins={props?.plugins ?? []} /> ); } diff --git a/src/controllers/router/types.ts b/src/controllers/router/types.ts index d3214877..3b5dc56b 100644 --- a/src/controllers/router/types.ts +++ b/src/controllers/router/types.ts @@ -14,7 +14,7 @@ export type RouterProps = PropsWithChildren<{ isGlobal?: boolean; onPrefetch?: (routerContext: RouterContext) => void; routes: Routes; - plugins: Plugin[]; + plugins?: Plugin[]; }>; export type MemoryRouterProps = PropsWithChildren<{