Skip to content

Commit

Permalink
[8.x] [React@18] fix incorrect `useEffect` return value (#1…
Browse files Browse the repository at this point in the history
…95421) (#195468)

# Backport

This will backport the following commits from `main` to `8.x`:
- [[React@18] fix incorrect `useEffect` return value
(#195421)](#195421)

<!--- Backport version: 9.4.3 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Anton
Dosov","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-10-08T16:17:17Z","message":"[React@18]
fix incorrect `useEffect` return value
(#195421)","sha":"d03537f21764fda1fbafcfec03391b3e03b64e82","branchLabelMapping":{"^v9.0.0$":"main","^v8.16.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","v9.0.0","Team:SharedUX","backport:prev-minor"],"title":"[React@18]
fix incorrect `useEffect` return
value","number":195421,"url":"https://github.com/elastic/kibana/pull/195421","mergeCommit":{"message":"[React@18]
fix incorrect `useEffect` return value
(#195421)","sha":"d03537f21764fda1fbafcfec03391b3e03b64e82"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/195421","number":195421,"mergeCommit":{"message":"[React@18]
fix incorrect `useEffect` return value
(#195421)","sha":"d03537f21764fda1fbafcfec03391b3e03b64e82"}}]}]
BACKPORT-->

Co-authored-by: Anton Dosov <[email protected]>
  • Loading branch information
kibanamachine and Dosant authored Oct 8, 2024
1 parent db6cd8f commit 21f9d06
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 21f9d06

Please sign in to comment.