Skip to content

Commit

Permalink
Updated plugins to fallback to empty array (#229)
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexanderKaran authored Mar 7, 2024
1 parent 9ee2842 commit 9b8cbe3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/controllers/router/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export const Router = ({
initialRoute={initialRoute}
isGlobal={isGlobal}
onPrefetch={onPrefetch}
plugins={plugins}
plugins={plugins ?? []}
routes={routes}
>
{children}
Expand All @@ -44,7 +44,7 @@ export function MemoryRouter(props: MemoryRouterProps) {
{...props}
history={history}
isGlobal={false}
plugins={props.plugins || []}
plugins={props?.plugins ?? []}
/>
);
}
2 changes: 1 addition & 1 deletion src/controllers/router/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export type RouterProps = PropsWithChildren<{
isGlobal?: boolean;
onPrefetch?: (routerContext: RouterContext) => void;
routes: Routes;
plugins: Plugin[];
plugins?: Plugin[];
}>;

export type MemoryRouterProps = PropsWithChildren<{
Expand Down

0 comments on commit 9b8cbe3

Please sign in to comment.