fix: resolve circular type inference in _app/index.tsx route
The dashboard route imported Route from '../_app', which resolves to itself (_app/index.tsx IS the _app route), creating a self-referencing circular type inference (TS7022/TS7023). Fix by importing the root route from '__root' as the parent, which is the correct ancestor in the route tree hierarchy.
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
import { useState, useEffect } from "react";
|
import { useState, useEffect } from "react";
|
||||||
import { createRoute } from "@tanstack/react-router";
|
import { createRoute } from "@tanstack/react-router";
|
||||||
import { Route as appRoute } from "../_app";
|
import { Route as rootRoute } from "../__root";
|
||||||
import { useQuery, useMutation, useQueryClient } from "@tanstack/react-query";
|
import { useQuery, useMutation, useQueryClient } from "@tanstack/react-query";
|
||||||
import { api, useApiQuery, useApiMutation } from "@/lib/api";
|
import { api, useApiQuery, useApiMutation } from "@/lib/api";
|
||||||
import { useRealtime } from "@/hooks/use-realtime";
|
import { useRealtime } from "@/hooks/use-realtime";
|
||||||
@@ -505,7 +505,7 @@ function DashboardPage() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export const Route = createRoute({
|
export const Route = createRoute({
|
||||||
getParentRoute: () => appRoute,
|
getParentRoute: () => rootRoute,
|
||||||
path: "/",
|
path: "/",
|
||||||
component: DashboardPage,
|
component: DashboardPage,
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user