Skip to content

Commit

Permalink
[Search] Stop rerendering connector pages unnecessarily (#189103)
Browse files Browse the repository at this point in the history
## Summary

This stops the connector tabs from incessantly re-rendering.
  • Loading branch information
sphilipse authored Jul 25, 2024
1 parent bfb24ef commit a35d317
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* 2.0.
*/

import React, { useEffect } from 'react';
import React, { useEffect, useMemo } from 'react';
import { useParams } from 'react-router-dom';

import { useActions, useValues } from 'kea';
Expand Down Expand Up @@ -236,7 +236,7 @@ export const ConnectorDetail: React.FC = () => {
...CONFIG_TAB,
];

const selectedTab = tabs.find((tab) => tab.id === tabId);
const selectedTab = useMemo(() => tabs.find((tab) => tab.id === tabId), [tabId]);

return (
<EnterpriseSearchContentPageTemplate
Expand Down

0 comments on commit a35d317

Please sign in to comment.