From 03059501e58e2940efa5a750dac099cb612e5c29 Mon Sep 17 00:00:00 2001 From: Edoardo Sabadelli Date: Wed, 21 Jun 2023 15:04:45 +0200 Subject: [PATCH] fix: solve the infinite loop I don't fully understand this. --- .../Item/VisualizationItem/Visualization/IframePlugin.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/Item/VisualizationItem/Visualization/IframePlugin.js b/src/components/Item/VisualizationItem/Visualization/IframePlugin.js index 73ee4e50c..936dd7106 100644 --- a/src/components/Item/VisualizationItem/Visualization/IframePlugin.js +++ b/src/components/Item/VisualizationItem/Visualization/IframePlugin.js @@ -4,7 +4,7 @@ import { CenteredContent, CircularLoader } from '@dhis2/ui' //import postRobot from '@krakenjs/post-robot' import PropTypes from 'prop-types' import React, { useCallback, useEffect, useMemo, useState } from 'react' -import { useDispatch, useSelector } from 'react-redux' +import { useDispatch, useSelector, shallowEqual } from 'react-redux' import { acAddIframePluginStatus } from '../../../../actions/iframePluginStatus.js' import { CHART, @@ -38,7 +38,7 @@ const IframePlugin = ({ isFirstOfType, }) => { const dispatch = useDispatch() - const iframePluginStatus = useSelector(sGetIframePluginStatus) + const iframePluginStatus = useSelector(sGetIframePluginStatus, shallowEqual) const { d2 } = useD2() const { baseUrl } = useConfig()