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
The test passes, but type checking unfortunately doesn't because createRoutesStub expects each route segment to have the predefined stub shapes, so if any data loading is going on this will cause those segments to not match those shapes anymore. For example:
typescript: Type '({ loaderData }: ComponentProps) => Element' is not assignable to type 'ComponentType<{}> | null | undefined'.
Type '({ loaderData }: ComponentProps) => Element' is not assignable to type 'FunctionComponent<{}>'.
Types of parameters '__0' and 'props' are incompatible.
Type '{}' is missing the following properties from type 'ComponentProps': params, loaderData, matches
The text was updated successfully, but these errors were encountered:
I'm using React Router as a...
framework
Reproduction
Create a route
app/routes/home.tsx
route with the following content:Register the route in
app/routes.ts
:Now create a
app/routes/home.test.tsx
file to test this route:System Info
Used Package Manager
npm
Expected Behavior
Both the test and type checking passes.
Actual Behavior
The test passes, but type checking unfortunately doesn't because
createRoutesStub
expects each route segment to have the predefined stub shapes, so if any data loading is going on this will cause those segments to not match those shapes anymore. For example:The text was updated successfully, but these errors were encountered: