From 61b1f024b33566c59d5a11bbcd09011706b94d39 Mon Sep 17 00:00:00 2001 From: john Date: Thu, 21 May 2026 16:01:46 -0700 Subject: [PATCH] fix: rename window variable to avoid Hermes global collision and add listener cleanup Co-Authored-By: Claude Sonnet 4.6 --- src/hooks/useAnimatedLayout.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/hooks/useAnimatedLayout.ts b/src/hooks/useAnimatedLayout.ts index 68c674de..6e3be3d1 100644 --- a/src/hooks/useAnimatedLayout.ts +++ b/src/hooks/useAnimatedLayout.ts @@ -106,13 +106,14 @@ export function useAnimatedLayout( [state, verticalInset, modal] ); useEffect(() => { - Dimensions.addEventListener('change', ({ window }) => { + const subscription = Dimensions.addEventListener('change', ({ window: windowDimensions }) => { state.modify(_state => { 'worklet'; - _state.window = window; + _state.window = windowDimensions; return _state; }); }); + return () => subscription.remove(); }, [state]); //#endregion