TanStackT
TanStack6mo ago
9 replies
skinny-azure

Route.useParams() giving Unsafe assignment of an error typed value

export const Route = createFileRoute('/(app)/portfolio/create/$userId/story/select')({
  component: UserStory,
});

function UserStory() {
  const { userId } = Route.useParams();


I am trying to access the userId part of dynamic route and I am getting typescript error.
Is it ideal to have this much of nested levels part of file based route strcuture?

Unsafe assignment of an error typed value.eslint@typescript-eslint/no-unsafe-assignment
+click to open in new tab
(property) RouteExtensions<"/(app)/portfolio/create/$userId/story/select", "/portfolio/create/$userId/story/select">.useParams: <RouterCore<Route<any, "/", "/", string, "root", undefined, {}, MyRootContext, AnyContext, AnyContext, {}, undefined, RootRouteChildren, FileRouteTypes>, "never", false, RouterHistory, Record<...>>, unknown, boolean>(opts?: (UseParamsBaseOptions<...> & OptionalStructuralSharing<...>) | undefined) => {
Was this page helpful?