Skip to content

Commit

Permalink
[Logs UI] Update <LogStream /> internal state when its props change (#…
Browse files Browse the repository at this point in the history
…83302)

Co-authored-by: Kibana Machine <[email protected]>
  • Loading branch information
Alejandro Fernández Gómez and kibanamachine authored Nov 18, 2020
1 parent a7e5f07 commit 00c0535
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions x-pack/plugins/infra/public/components/log_stream/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@
* you may not use this file except in compliance with the Elastic License.
*/

import React, { useMemo, useCallback } from 'react';
import React, { useMemo, useCallback, useEffect } from 'react';
import { noop } from 'lodash';
import useMount from 'react-use/lib/useMount';
import { euiStyled } from '../../../../observability/public';

import { LogEntriesCursor } from '../../../common/http_api';
Expand Down Expand Up @@ -100,10 +99,13 @@ Read more at https://github.com/elastic/kibana/blob/master/src/plugins/kibana_re
const parsedHeight = typeof height === 'number' ? `${height}px` : height;

// Component lifetime
useMount(() => {
useEffect(() => {
loadSourceConfiguration();
}, [loadSourceConfiguration]);

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

// Pagination handler
const handlePagination = useCallback(
Expand Down

0 comments on commit 00c0535

Please sign in to comment.