From 51fa2b36989c5ee8a73d3a13a903c49392a4419a Mon Sep 17 00:00:00 2001 From: Vojtech Novak Date: Thu, 5 Aug 2021 21:47:06 +0200 Subject: [PATCH] chore: remove unnecessary useMemos (#515) --- .../bottomSheetBackdrop/BottomSheetBackdrop.tsx | 5 +---- .../BottomSheetBackgroundContainer.tsx | 8 +++----- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/src/components/bottomSheetBackdrop/BottomSheetBackdrop.tsx b/src/components/bottomSheetBackdrop/BottomSheetBackdrop.tsx index 43f1716fe..ba2dedb4c 100644 --- a/src/components/bottomSheetBackdrop/BottomSheetBackdrop.tsx +++ b/src/components/bottomSheetBackdrop/BottomSheetBackdrop.tsx @@ -37,10 +37,7 @@ const BottomSheetBackdropComponent = ({ //#region variables const containerRef = useRef(null); - const pointerEvents = useMemo( - () => (enableTouchThrough ? 'none' : 'auto'), - [enableTouchThrough] - ); + const pointerEvents = enableTouchThrough ? 'none' : 'auto'; //#endregion //#region callbacks diff --git a/src/components/bottomSheetBackgroundContainer/BottomSheetBackgroundContainer.tsx b/src/components/bottomSheetBackgroundContainer/BottomSheetBackgroundContainer.tsx index 4b91763e8..b9ca94f5d 100644 --- a/src/components/bottomSheetBackgroundContainer/BottomSheetBackgroundContainer.tsx +++ b/src/components/bottomSheetBackgroundContainer/BottomSheetBackgroundContainer.tsx @@ -1,4 +1,4 @@ -import React, { memo, useMemo } from 'react'; +import React, { memo } from 'react'; import BottomSheetBackground from '../bottomSheetBackground'; import type { BottomSheetBackgroundContainerProps } from './types'; import { styles } from './styles'; @@ -8,10 +8,8 @@ const BottomSheetBackgroundContainerComponent = ({ animatedPosition, backgroundComponent: _providedBackgroundComponent, }: BottomSheetBackgroundContainerProps) => { - const BackgroundComponent = useMemo( - () => _providedBackgroundComponent || BottomSheetBackground, - [_providedBackgroundComponent] - ); + const BackgroundComponent = + _providedBackgroundComponent || BottomSheetBackground; return _providedBackgroundComponent === null ? null : (