You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
***perf:** reduced unnecessary onPercentChange callback calls when last percent is already 0 ([39e8aa8](https://github.com/JairajJangle/react-native-visibility-sensor/commit/39e8aa847b42eabe9341e4bec96c35f1b8c67972))
* added missing state dependencies in visiblity calculations ([af0161c](https://github.com/JairajJangle/react-native-visibility-sensor/commit/af0161c6fcfb4d72f7db97e7fb1c88cc96706c13))
* handle initial visibility state and improve measurement timing ([f5e4de7](https://github.com/JairajJangle/react-native-visibility-sensor/commit/f5e4de7dd7802951a5654fe9ab8cf574f9f4d52d))
22
+
* prevent race conditions during rapid mount/unmount cycles ([de6cb59](https://github.com/JairajJangle/react-native-visibility-sensor/commit/de6cb59111b4b8944d3070bb826290b8941340c5))
23
+
* prevent state updates on unmounted components ([6c9786a](https://github.com/JairajJangle/react-native-visibility-sensor/commit/6c9786a1ccc46e5c48813e349a7e6aabb9b4052a))
24
+
25
+
26
+
### Features
27
+
28
+
* added percent visiblity callback requested in [#44](https://github.com/JairajJangle/react-native-visibility-sensor/issues/44) ([e78fa27](https://github.com/JairajJangle/react-native-visibility-sensor/commit/e78fa27a9fe2d8c37227f3ab6022964aeafe8b37))
29
+
30
+
31
+
### Performance Improvements
32
+
33
+
* conserved percent calc. if view is not visible - [#44](https://github.com/JairajJangle/react-native-visibility-sensor/issues/44) ([81d0036](https://github.com/JairajJangle/react-native-visibility-sensor/commit/81d003651348dcfb871d832137330d174f1f56e2))
| onChange | (visible: boolean) => void | Yes | Callback function that fires when visibility changes. |
67
-
| disabled | boolean | No | If `true`, disables the sensor. |
68
-
| triggerOnce | boolean | No | If `true`, the sensor will only trigger once. |
69
-
| delay | number \| undefined | No | The delay in milliseconds before the sensor triggers. |
70
-
| threshold |[VisibilitySensorThreshold](#visibilitysensorthreshold)| No | Defines the part of the view that must be visible for the sensor to trigger. |
|`onChange`|`(visible: boolean) => void`| Yes | Callback function that fires when visibility changes. |
64
+
|`onPercentChange`|`(percentVisible: number) => void`| No | Callback function that fires when visibility % changes. |
65
+
|`disabled`|`boolean`| No | If `true`, disables the sensor. |
66
+
|`triggerOnce`|`boolean`| No | If `true`, the sensor will only trigger once. |
67
+
|`delay`|`number` or `undefined`| No | The delay in milliseconds before the sensor triggers. |
68
+
|`threshold`|[VisibilitySensorThreshold](#visibilitysensorthreshold)| No | Defines the part of the view that must be visible for the sensor to trigger. |
71
69
72
70
Additionally, all properties from `ViewProps` are also applicable.
0 commit comments