Skip to content

Commit

Permalink
fix: default types should be Record<string, unknown> (#5749)
Browse files Browse the repository at this point in the history
  • Loading branch information
GiveMe-A-Name authored May 24, 2024
1 parent d85f134 commit 7834d4b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
6 changes: 6 additions & 0 deletions .changeset/lemon-lies-mate.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@modern-js/runtime': patch
---

fix: default types should be `Record<string, unknown>`
fix: 默认 types 应该是 `Record<string, unknown>`
5 changes: 3 additions & 2 deletions packages/runtime/plugin-runtime/src/router/runtime/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,9 @@ interface DataFunctionArgs<D = any> {
context?: D;
}

export type LoaderFunctionArgs<P extends Record<string, unknown> = any> =
DataFunctionArgs<RequestContext<P>>;
export type LoaderFunctionArgs<
P extends Record<string, unknown> = Record<string, unknown>,
> = DataFunctionArgs<RequestContext<P>>;

declare type DataFunctionValue = Response | NonNullable<unknown> | null;

Expand Down

0 comments on commit 7834d4b

Please sign in to comment.