Skip to content

Commit 6f10781

Browse files
committed
refactor(types): refine the generic type
1 parent c152ddb commit 6f10781

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/use-web-animations.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ declare module "@wellyshen/use-web-animations" {
4949
animate: Animate;
5050
}
5151

52-
const useWebAnimations: <T extends HTMLElement>(
52+
const useWebAnimations: <T extends HTMLElement | null = HTMLElement>(
5353
options?: Options<T>
5454
) => Return<T>;
5555

src/useWebAnimations.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ interface Return<T> {
4141
animate: Animate;
4242
}
4343

44-
const useWebAnimations = <T extends HTMLElement>({
44+
const useWebAnimations = <T extends HTMLElement | null>({
4545
ref: refOpt,
4646
id,
4747
playbackRate,

0 commit comments

Comments
 (0)