Skip to content

Commit

Permalink
Wrap error renderer in span (#7265)
Browse files Browse the repository at this point in the history
Signed-off-by: Craig Perkins <cwperx@amazon.com>
  • Loading branch information
cwperks authored Jul 17, 2024
1 parent 6d6ffaa commit a34389e
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
* under the License.
*/

import React, { Fragment } from 'react';
import React from 'react';
import { History } from 'history';
import { i18n } from '@osd/i18n';
import { EuiLoadingSpinner } from '@elastic/eui';
Expand All @@ -37,10 +37,9 @@ import ReactDOM from 'react-dom';
import { ApplicationStart, HttpStart, ToastsSetup } from 'opensearch-dashboards/public';
import { SavedObjectNotFound } from '..';

const ReactMarkdown = React.lazy(() => import('react-markdown'));
const ErrorRenderer = (props: { children: string }) => (
<React.Suspense fallback={<EuiLoadingSpinner />}>
<ReactMarkdown renderers={{ root: Fragment }} {...props} />
<span>{props.children}</span>
</React.Suspense>
);

Expand Down

0 comments on commit a34389e

Please sign in to comment.