diff --git a/.changeset/lemon-lies-mate.md b/.changeset/lemon-lies-mate.md new file mode 100644 index 000000000000..5dd066def314 --- /dev/null +++ b/.changeset/lemon-lies-mate.md @@ -0,0 +1,6 @@ +--- +'@modern-js/runtime': patch +--- + +fix: default types should be `Record` +fix: 默认 types 应该是 `Record` diff --git a/packages/runtime/plugin-runtime/src/router/runtime/types.ts b/packages/runtime/plugin-runtime/src/router/runtime/types.ts index 273638fbc71d..1138d73aa770 100644 --- a/packages/runtime/plugin-runtime/src/router/runtime/types.ts +++ b/packages/runtime/plugin-runtime/src/router/runtime/types.ts @@ -71,8 +71,9 @@ interface DataFunctionArgs { context?: D; } -export type LoaderFunctionArgs

= any> = - DataFunctionArgs>; +export type LoaderFunctionArgs< + P extends Record = Record, +> = DataFunctionArgs>; declare type DataFunctionValue = Response | NonNullable | null;