diff --git a/packages/react-router/src/useHoistedRoutes.ts b/packages/react-router/src/useHoistedRoutes.ts index 9efab575e..84c593c69 100644 --- a/packages/react-router/src/useHoistedRoutes.ts +++ b/packages/react-router/src/useHoistedRoutes.ts @@ -27,7 +27,7 @@ function getAllRoutePaths(route: Route) { return !isNil(current) ? [current] : []; } -export function useHoistedRoutes(routes: RootRoute[], wrapManagedRoutes: (routes: Route[]) => Route, { allowedPaths }: UseHoistedRoutesOptions = {}) { +export function useHoistedRoutes(routes: RootRoute[], wrapManagedRoutes: (routes: Route[]) => Route, { allowedPaths }: UseHoistedRoutesOptions = {}): Route[] { // Hack to reuse the same array reference through re-renders. const [memoizedAllowedPaths] = useState(allowedPaths);