diff --git a/kafka-ui-react-app/src/components/Topics/List/List.tsx b/kafka-ui-react-app/src/components/Topics/List/List.tsx index 888fee7677f..4bb5529059d 100644 --- a/kafka-ui-react-app/src/components/Topics/List/List.tsx +++ b/kafka-ui-react-app/src/components/Topics/List/List.tsx @@ -88,8 +88,8 @@ const List: React.FC = ({ const [cachedPage, setCachedPage] = React.useState(null); const history = useHistory(); - React.useEffect(() => { - fetchTopicsList({ + const topicsListParams = React.useMemo( + () => ({ clusterName, page, perPage, @@ -97,17 +97,13 @@ const List: React.FC = ({ sortOrder, search, showInternal, - }); - }, [ - fetchTopicsList, - clusterName, - page, - perPage, - orderBy, - sortOrder, - search, - showInternal, - ]); + }), + [clusterName, page, perPage, orderBy, sortOrder, search, showInternal] + ); + + React.useEffect(() => { + fetchTopicsList(topicsListParams); + }, [fetchTopicsList, topicsListParams]); const tableState = useTableState< TopicWithDetailedInfo, @@ -190,6 +186,7 @@ const List: React.FC = ({ } closeConfirmationModal(); clearSelectedTopics(); + fetchTopicsList(topicsListParams); }, [ confirmationModal, clearSelectedTopics, @@ -197,6 +194,8 @@ const List: React.FC = ({ deleteTopics, clearTopicsMessages, tableState.selectedIds, + fetchTopicsList, + topicsListParams, ]); const ActionsCell = React.memo>(