-
Notifications
You must be signed in to change notification settings - Fork 3
Open
Description
I have a loader with defer:
import { defer } from 'react-router-typesafe';
...
export const dashboardLoader = (queryClient: QueryClient) => () => {
return defer<{
dashboardInfo: Promise<DashboardType>;
}>({
dashboardInfo: queryClient.ensureQueryData(dashboardInfoQueries.info()),
});
};and I have a RouteObject like this in typesafeBrowserRouter:
{
index: true,
loader: dashboardLoader(queryClient),
async lazy() {
const { Dashboard } = await import('@/views/dashboard/Dashboard');
return { element: <Dashboard /> };
},
},I get an error: Type () => DeferredData<{ dashboardInfo: Promise<DashboardType>; }> is not assignable to type NarrowKeys<boolean | LoaderFunction<any> | undefined>
This doesn't happen when I am using a regular loader without defer.
Oh, and when I just switch from typesafeBrowserRouter to createBrowserRouter everything works just fine since then, loader doesn't have that NarrowKeys type.
Metadata
Metadata
Assignees
Labels
No labels