Skip to content

Commit 6efd26b

Browse files
v-moeDaniel DAbramo
andauthored
feat: allow readonly array as argument to useRoutes (#256)
Co-authored-by: Daniel DAbramo <[email protected]>
1 parent a8a32b9 commit 6efd26b

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/components.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,10 @@ export const Routes = (props: RoutesProps) => {
154154
);
155155
};
156156

157-
export const useRoutes = (routes: RouteDefinition | RouteDefinition[], base?: string) => {
157+
export const useRoutes = (
158+
routes: RouteDefinition | RouteDefinition[] | Readonly<RouteDefinition[]>,
159+
base?: string
160+
) => {
158161
return () => <Routes base={base}>{routes as any}</Routes>;
159162
};
160163

0 commit comments

Comments
 (0)