You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What is the correct approach to share route types between pages that share a common dynamic path? All my paths are prefix with tenantId and spaceId and I think it would make sense to to import { Route, type RouteType } from "../routeType"; for the different pages. The resulting typedefs look like the following when I don't put a routeType.ts into each and every single directory. Did I misunderstand how to properly use it?
For now I used symlinks instead of creating duplicates of the routeType.ts in the [spaceId] directory to not make the routes StaticRoute
I think you should probably still aim to have a routeType.ts for every route, just like you have a page.tsx for every route. You can define the schema in one place and import it in each file.
I see how its a bit repitive but im not sure symlinking is a superior solution, but let me know how things go
What is the correct approach to share route types between pages that share a common dynamic path? All my paths are prefix with
tenantId
andspaceId
and I think it would make sense to toimport { Route, type RouteType } from "../routeType";
for the different pages. The resulting typedefs look like the following when I don't put arouteType.ts
into each and every single directory. Did I misunderstand how to properly use it?For now I used symlinks instead of creating duplicates of the
routeType.ts
in the[spaceId]
directory to not make the routesStaticRoute
The text was updated successfully, but these errors were encountered: