From 24b1681389c56e1776743895d3ac51cf8058d843 Mon Sep 17 00:00:00 2001 From: s-alves10 Date: Tue, 10 Oct 2023 21:44:41 -0500 Subject: [PATCH 1/3] fix: remove unnecessary dependency --- src/components/PopoverWithoutOverlay/index.js | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/components/PopoverWithoutOverlay/index.js b/src/components/PopoverWithoutOverlay/index.js index d35637958f1d..3b194ad4b9cf 100644 --- a/src/components/PopoverWithoutOverlay/index.js +++ b/src/components/PopoverWithoutOverlay/index.js @@ -8,7 +8,6 @@ import styles from '../../styles/styles'; import * as StyleUtils from '../../styles/StyleUtils'; import getModalStyles from '../../styles/getModalStyles'; import withWindowDimensions from '../withWindowDimensions'; -import usePrevious from '../../hooks/usePrevious'; function Popover(props) { const {onOpen, close} = React.useContext(PopoverContext); @@ -25,8 +24,6 @@ function Popover(props) { props.outerStyle, ); - const prevIsVisible = usePrevious(props.isVisible); - React.useEffect(() => { if (props.isVisible) { props.onModalShow(); @@ -43,7 +40,7 @@ function Popover(props) { Modal.willAlertModalBecomeVisible(props.isVisible); // We prevent setting closeModal function to null when the component is invisible the first time it is rendered - if (prevIsVisible === props.isVisible && (!firstRenderRef.current || !props.isVisible)) { + if (!firstRenderRef.current || !props.isVisible) { firstRenderRef.current = false; return; } @@ -52,7 +49,7 @@ function Popover(props) { // We want this effect to run strictly ONLY when isVisible prop changes // eslint-disable-next-line react-hooks/exhaustive-deps - }, [props.isVisible, prevIsVisible]); + }, [props.isVisible]); if (!props.isVisible) { return null; From 8b6e99cd25e30d95d8dffbb7be3c104fdec8c8cb Mon Sep 17 00:00:00 2001 From: s-alves10 Date: Tue, 10 Oct 2023 22:16:41 -0500 Subject: [PATCH 2/3] fix: try to re-run performance test --- src/components/PopoverWithoutOverlay/index.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/components/PopoverWithoutOverlay/index.js b/src/components/PopoverWithoutOverlay/index.js index 3b194ad4b9cf..6775e78eb314 100644 --- a/src/components/PopoverWithoutOverlay/index.js +++ b/src/components/PopoverWithoutOverlay/index.js @@ -9,6 +9,7 @@ import * as StyleUtils from '../../styles/StyleUtils'; import getModalStyles from '../../styles/getModalStyles'; import withWindowDimensions from '../withWindowDimensions'; + function Popover(props) { const {onOpen, close} = React.useContext(PopoverContext); const firstRenderRef = useRef(true); From 944b3387d2cbdacf48d1e1fa0873b0c52557c63e Mon Sep 17 00:00:00 2001 From: s-alves10 Date: Tue, 10 Oct 2023 22:17:08 -0500 Subject: [PATCH 3/3] fix: try to re-run performance test --- src/components/PopoverWithoutOverlay/index.js | 1 - 1 file changed, 1 deletion(-) diff --git a/src/components/PopoverWithoutOverlay/index.js b/src/components/PopoverWithoutOverlay/index.js index 6775e78eb314..3b194ad4b9cf 100644 --- a/src/components/PopoverWithoutOverlay/index.js +++ b/src/components/PopoverWithoutOverlay/index.js @@ -9,7 +9,6 @@ import * as StyleUtils from '../../styles/StyleUtils'; import getModalStyles from '../../styles/getModalStyles'; import withWindowDimensions from '../withWindowDimensions'; - function Popover(props) { const {onOpen, close} = React.useContext(PopoverContext); const firstRenderRef = useRef(true);