Skip to content

Commit

Permalink
perf: Memoize BottomSheetV2 imperative handle
Browse files Browse the repository at this point in the history
  • Loading branch information
dcalhoun committed Sep 5, 2023
1 parent c0a14ab commit a13fd7b
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions packages/components/src/mobile/bottom-sheet-v2/index.native.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
Expand Down

0 comments on commit a13fd7b

Please sign in to comment.