From 4803d48ec79c534256637cda8bde38d9c35adbef Mon Sep 17 00:00:00 2001 From: ajbura Date: Tue, 8 Feb 2022 17:59:15 +0530 Subject: [PATCH] Fix bug in this.isRawModalVisible Signed-off-by: ajbura --- src/app/atoms/modal/RawModal.jsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/app/atoms/modal/RawModal.jsx b/src/app/atoms/modal/RawModal.jsx index 31693cd..306d7d1 100644 --- a/src/app/atoms/modal/RawModal.jsx +++ b/src/app/atoms/modal/RawModal.jsx @@ -1,4 +1,4 @@ -import React from 'react'; +import React, { useEffect } from 'react'; import PropTypes from 'prop-types'; import './RawModal.scss'; @@ -26,7 +26,9 @@ function RawModal({ modalClass += 'raw-modal__small '; } - navigation.setIsRawModalVisible(isOpen); + useEffect(() => { + navigation.setIsRawModalVisible(isOpen); + }, [isOpen]); const modalOverlayClass = (overlayClassName !== null) ? `${overlayClassName} ` : ''; return (