Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hotfix: document.querySelector returns null if there are no nodes are… #5

Merged
merged 1 commit into from
Jul 23, 2024

Conversation

niko7o
Copy link
Contributor

@niko7o niko7o commented Jul 23, 2024

Hey dude! First of all, i'd like to say I really like the library. Thanks for sharing it with the community.

Context

With version 0.0.5, TypeScript currently complains that the document.querySelector method inside the createSwapy does not always necessarily return an element: if there are no nodes found whatsoever, it will return null.

This PR fixes the type definition so that we don't need to @ts-ignore any of our uses of this library. Ideally it should probably be a patch 0.0.6 release.

Screenshots

before after
image image

GIF

Here's a GIF for good luck with the project 💟

@TahaSh
Copy link
Owner

TahaSh commented Jul 23, 2024

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants