Skip to content

Commit

Permalink
chore(exists): make yarn-tsd happy
Browse files Browse the repository at this point in the history
  • Loading branch information
xanf committed Jun 28, 2022
1 parent 49e046e commit 5fb5b85
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/baseWrapper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,14 @@ export default abstract class BaseWrapper<ElementType extends Node>
}

exists() {
return !this.getCurrentComponent()?.isUnmounted
const currentComponent = this.getCurrentComponent()

if (!currentComponent) {
// DOM Node always exists
return true
}

return currentComponent.isUnmounted
}

get<K extends keyof HTMLElementTagNameMap>(
Expand Down

0 comments on commit 5fb5b85

Please sign in to comment.