-
-
Couldn't load subscription status.
- Fork 10.7k
Closed
Labels
Description
What version of React Router are you using?
6.8.2
Steps to Reproduce
Write a function that return undefined or nothing in a loader of a route.
Expected Behavior
Type Script error.
This type
/**
* Route loader function signature
*/
export interface LoaderFunction {
(args: LoaderFunctionArgs): Promise<Response> | Response | Promise<any> | any;
}
should be rewritten
/**
* Route loader function signature
*/
export interface LoaderFunction {
(args: LoaderFunctionArgs): Promise<Response> | Response | Promise<string | number | boolean | symbol | object | null> | string | number | boolean | symbol | object | null;
}
Actual Behavior
No TS error, and so there will be an error at runtime.