Skip to content

feat: added percent visiblity callback#45

Merged
JairajJangle merged 24 commits into
mainfrom
beta
Aug 26, 2025
Merged

feat: added percent visiblity callback#45
JairajJangle merged 24 commits into
mainfrom
beta

Conversation

@JairajJangle
Copy link
Copy Markdown
Owner

  • feat: added percent visiblity callback

JairajJangle and others added 24 commits June 21, 2025 23:05
- Add isMountedRef to track component lifecycle
- Check mounted state before calling setRectDimensions in measure callback
- Prevent React warnings about state updates on unmounted components
- Add measurement state tracking with enum (IDLE, MEASURING, MEASURED)
- Prevent concurrent measure() calls from overlapping
- Fix incorrect visibility reports during fast scrolling in lists
- Ensure only one measurement executes at a time per component
- Use useWindowDimensions hook to track viewport changes
- Reset measurement state when dimensions change to force remeasurement
- Fixes visibility calculations after device rotation or split-view changes
- Add immediate measurement on component mount to report initial visibility
- Convert measureInnerView to useCallback to prevent unnecessary re-renders
# [1.4.0-beta.1](v1.3.22...v1.4.0-beta.1) (2025-08-23)

### Bug Fixes

* add window dimension change listener to handle orientation changes ([5f640db](5f640db))
* handle initial visibility state and improve measurement timing ([f5e4de7](f5e4de7))
* prevent race conditions during rapid mount/unmount cycles ([de6cb59](de6cb59))
* prevent state updates on unmounted components ([6c9786a](6c9786a))

### Features

* added percent visiblity callback requested in [#44](#44) ([e78fa27](e78fa27))

### Performance Improvements

* conserved percent calc. if view is not visible - [#44](#44) ([81d0036](81d0036))
# [1.4.0-beta.2](v1.4.0-beta.1...v1.4.0-beta.2) (2025-08-23)

### Bug Fixes

* added missing state dependencies in visiblity calculations ([af0161c](af0161c))
# [1.4.0-beta.3](v1.4.0-beta.2...v1.4.0-beta.3) (2025-08-26)

### Bug Fixes

* **perf:** reduced unnecessary onPercentChange callback calls when last percent is already 0 ([39e8aa8](39e8aa8))
@JairajJangle JairajJangle merged commit 420e448 into main Aug 26, 2025
11 checks passed
@github-actions
Copy link
Copy Markdown

🎉 This PR is included in version 1.4.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@JairajJangle JairajJangle deleted the beta branch January 30, 2026 12:47
@JairajJangle JairajJangle restored the beta branch January 30, 2026 12:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants