Skip to content

Commit

Permalink
Fix: change NaN to Number.isNaN (#413)
Browse files Browse the repository at this point in the history
  • Loading branch information
dbismut authored Dec 12, 2021
1 parent 59e6389 commit ae63100
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/violet-avocados-bake.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@use-gesture/core': patch
---

fix: change isNaN to Number.isNaN in dev mode
2 changes: 1 addition & 1 deletion packages/core/src/config/resolver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export function resolveWith<T extends { [k: string]: any }, V extends { [k: stri
if (process.env.NODE_ENV === 'development') {
const r = resolver.call(result, config[key], key, config)
// prevents deprecated resolvers from applying in dev mode
if (!isNaN(r)) result[key] = r
if (!Number.isNaN(r)) result[key] = r
} else {
result[key] = resolver.call(result, config[key], key, config)
}
Expand Down

0 comments on commit ae63100

Please sign in to comment.