From a13fd7b2d69d9fa61643c6bb8a9c6eae881c219c Mon Sep 17 00:00:00 2001 From: David Calhoun Date: Tue, 5 Sep 2023 15:45:42 -0400 Subject: [PATCH] perf: Memoize BottomSheetV2 imperative handle --- .../src/mobile/bottom-sheet-v2/index.native.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/packages/components/src/mobile/bottom-sheet-v2/index.native.js b/packages/components/src/mobile/bottom-sheet-v2/index.native.js index 80fc7222366e4..4d673e4dd6431 100644 --- a/packages/components/src/mobile/bottom-sheet-v2/index.native.js +++ b/packages/components/src/mobile/bottom-sheet-v2/index.native.js @@ -109,10 +109,14 @@ const BottomSheetModalWithRef = ( * would simplify migrating to `BottomSheetModal` in the future if the editor * header navigation is rendered by React Native, not the native host app. */ - useImperativeHandle( ref, () => ( { - present: handlePresent, - dismiss: handleDismiss, - } ) ); + useImperativeHandle( + ref, + () => ( { + present: handlePresent, + dismiss: handleDismiss, + } ), + [ handleDismiss, handlePresent ] + ); const handleClose = useCallback( () => { setVisible( false );