Skip to content

Commit

Permalink
Use Component<any> for generic component type
Browse files Browse the repository at this point in the history
  • Loading branch information
edemaine committed Apr 12, 2022
1 parent 1449595 commit 72a3ed0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/solid/src/render/component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ export function splitProps<T>(props: T, ...keys: Array<(keyof T)[]>) {
}

// lazy load a function component asynchronously
export function lazy<T extends Component>(
export function lazy<T extends Component<any>>(
fn: () => Promise<{ default: T }>
): T & { preload: () => Promise<{ default: T }> } {
let comp: () => T | undefined;
Expand Down
2 changes: 1 addition & 1 deletion packages/solid/src/server/rendering.ts
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,7 @@ export function createResource<T, U>(

export function refetchResources(info?: unknown) { }

export function lazy<T extends Component>(
export function lazy<T extends Component<any>>(
fn: () => Promise<{ default: T }>
): T & { preload: () => Promise<{ default: T }> } {
let resolved: T;
Expand Down

0 comments on commit 72a3ed0

Please sign in to comment.