Skip to content

Commit

Permalink
Add error handling recommendations
Browse files Browse the repository at this point in the history
  • Loading branch information
afgomez authored and Alejandro Fernández Gómez committed Sep 2, 2020
1 parent 1ed3dda commit 77d53a8
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion x-pack/plugins/infra/public/components/log_stream/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { LogStream } from '../../../../../../infra/public';
To use the component, there are several things you need to ensure in your plugin:

- In your `kibana.json` plugin, you need to either add `"requiredBundles": ["infra"]` or `"requiredPlugins": ["infra"]`.
- Your plugin needs to be wrapped with a [`kibana-react` provider](https://github.com/elastic/kibana/blob/b2d0aa7b7fae1c89c8f9e8854ae73e71be64e765/src/plugins/kibana_react/README.md#L45).
- The component needs to be mounted inside the hiearchy of a [`kibana-react` provider](https://github.com/elastic/kibana/blob/b2d0aa7b7fae1c89c8f9e8854ae73e71be64e765/src/plugins/kibana_react/README.md#L45).

## Usage

Expand Down Expand Up @@ -67,3 +67,7 @@ By default the `<LogStream />` uses the `"default"` source confiuration, but if
```tsx
<LogStream startTimestamp={startTimestamp} endTimestamp={endTimestamp} sourceId="my_source" />
```

### Considerations

As mentioned in the prerequisites, the component relies on `kibana-react` to access kibana's core services. If this is not the case the component will throw an exception when rendering. We advise to use an `<EuiErrorBoundary>` in your component hierarchy to catch this error if necessary.

0 comments on commit 77d53a8

Please sign in to comment.