File tree Expand file tree Collapse file tree 1 file changed +17
-4
lines changed
src/components/LazyChild/components Expand file tree Collapse file tree 1 file changed +17
-4
lines changed Original file line number Diff line number Diff line change @@ -55,17 +55,30 @@ export function FullLazyChild({
5555
5656 const _debug = useSharedValue ( debug ) ;
5757
58+ const _hasOnEnterCallback = useSharedValue (
59+ typeof onEnterThresholdPass === 'function'
60+ ) ;
61+ const _hasOnExitCallback = useSharedValue (
62+ typeof onExitThresholdPass === 'function'
63+ ) ;
64+ const _hasOnVisibilityEnterCallback = useSharedValue (
65+ typeof onVisibilityEnter === 'function'
66+ ) ;
67+ const _hasOnVisibilityExitCallback = useSharedValue (
68+ typeof onVisibilityExit === 'function'
69+ ) ;
70+
5871 const shouldFireThresholdEnter = useDerivedValue ( ( ) => {
59- return typeof onEnterThresholdPass === 'function' && ! isScrollUnmounted ;
72+ return _hasOnEnterCallback . value && ! isScrollUnmounted . value ;
6073 } ) ;
6174 const shouldFireThresholdExit = useDerivedValue ( ( ) => {
62- return typeof onExitThresholdPass === 'function' && ! isScrollUnmounted ;
75+ return _hasOnExitCallback . value && ! isScrollUnmounted . value ;
6376 } ) ;
6477 const shouldMeasurePercentVisible = useDerivedValue ( ( ) => {
65- return typeof onVisibilityEnter === 'function' && ! isScrollUnmounted ;
78+ return _hasOnVisibilityEnterCallback . value && ! isScrollUnmounted . value ;
6679 } ) ;
6780 const shouldFireVisibilityExit = useDerivedValue ( ( ) => {
68- return typeof onVisibilityExit === 'function' && ! isScrollUnmounted ;
81+ return _hasOnVisibilityExitCallback . value && ! isScrollUnmounted . value ;
6982 } ) ;
7083
7184 const _hasValidCallback = useDerivedValue (
You can’t perform that action at this time.
0 commit comments