Skip to content

Commit

Permalink
[React@18] fix incorrect useEffect return value (#195421)
Browse files Browse the repository at this point in the history
(cherry picked from commit d03537f)
  • Loading branch information
Dosant committed Oct 8, 2024
1 parent cf549c5 commit b1e6762
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@ export const ElasticsearchGuide = () => {
const { data } = useValues(FetchApiKeysAPILogic);
const apiKeys = data?.api_keys || [];

useEffect(() => makeRequest({}), []);
useEffect(() => {
makeRequest({});
}, []);

return (
<EnterpriseSearchElasticsearchPageTemplate>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,9 @@ export const ApiKeyPanel: React.FC = () => {
const [isFlyoutOpen, setIsFlyoutOpen] = useState(false);
const elasticsearchEndpoint = esConfig.elasticsearch_host;

useEffect(() => makeRequest({}), []);
useEffect(() => {
makeRequest({});
}, []);

const apiKeys = data?.api_keys || [];
const cloudId = cloud?.cloudId;
Expand Down

0 comments on commit b1e6762

Please sign in to comment.