Skip to content

Commit 76d24be

Browse files
committed
types: fix typing for options.attachTo
1 parent 418aff7 commit 76d24be

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/mount.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,9 +86,12 @@ export function mount(
8686
el.id = MOUNT_ELEMENT_ID
8787

8888
if (options?.attachTo) {
89-
const to = isString(options.attachTo)
90-
? document.querySelector(options.attachTo)
91-
: options.attachTo
89+
let to: Element
90+
if (typeof options.attachTo === 'string') {
91+
to = document.querySelector(options.attachTo)
92+
} else {
93+
to = options.attachTo
94+
}
9295

9396
if (!to) {
9497
throw new Error(

0 commit comments

Comments
 (0)