Use TypeScript's `ResizeObserver` types instead of `any`

This commit is contained in:
Evan Hahn 2021-11-05 08:25:25 -05:00 committed by GitHub
parent 0c83b1d26b
commit f02b1ebce2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 4 deletions

View File

@ -40,10 +40,7 @@ export function useHasWrapped<T extends HTMLElement>(): [Ref<T>, boolean] {
return noop;
}
// We can remove this `any` when we upgrade to TypeScript 4.2+, which adds
// `ResizeObserver` type definitions.
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const observer = new (window as any).ResizeObserver(() => {
const observer = new ResizeObserver(() => {
setHasWrapped(isWrapped(element));
});
observer.observe(element);