Skip to content

Tags: hustcc/size-sensor

Tags

v1.0.3

Toggle v1.0.3's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
fix: Add null check in destroy() before disconnecting sensor (#21)

* fix: Add null check in destroy() before disconnecting sensor

Fixes a TypeError that occurs when sensor.disconnect() is called
  on an already destroyed sensor during React StrictMode's double
  mount/unmount cycle.

  The destroy() function attempted to call sensor.disconnect()
  without checking if sensor was still defined, leading to:
  "TypeError: Cannot read properties of undefined (reading 'disconnect')"

  This commonly occurs in React 18+ StrictMode environments where
  components are intentionally mounted and unmounted twice to detect
  side effects, causing multiple destroy() calls on the same sensor.

* Bump version from 1.0.2 to 1.0.3

---------

Co-authored-by: hustcc <i@hust.cc>

v1.0.2

Toggle v1.0.2's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
fix: memory leak when unbind (#19)

v1.0.1

Toggle v1.0.1's commit message
chore: 1.0.1

v1.0.0

Toggle v1.0.0's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
update readme