File tree Expand file tree Collapse file tree 1 file changed +2
-9
lines changed
packages/module/src/LogViewer Expand file tree Collapse file tree 1 file changed +2
-9
lines changed Original file line number Diff line number Diff line change 11import React , { memo , useContext } from 'react' ;
2- import ReactDOMServer from 'react-dom/server' ;
32import { LOGGER_LINE_NUMBER_INDEX_DELTA } from './utils/constants' ;
43import { css } from '@patternfly/react-styles' ;
54import styles from '@patternfly/react-styles/css/components/LogViewer/log-viewer' ;
@@ -51,16 +50,10 @@ export const LogViewerRow: React.FunctionComponent<LogViewerRowProps> = memo(({
5150 composedString . push ( str ) ;
5251 } else {
5352 const splitString = str . split ( regEx ) ;
54- splitString . forEach ( ( substr , newIndex ) => {
53+ splitString . forEach ( ( substr ) => {
5554 if ( substr . match ( regEx ) ) {
5655 matchCounter += 1 ;
57- composedString . push (
58- ReactDOMServer . renderToString (
59- < span className = { css ( styles . logViewerString , handleHighlight ( matchCounter ) ) } key = { newIndex } >
60- { substr }
61- </ span >
62- )
63- ) ;
56+ composedString . push ( `<span class="${ css ( styles . logViewerString , handleHighlight ( matchCounter ) ) } ">${ substr } </span>` ) ;
6457 } else {
6558 composedString . push ( escapeTextForHtml ( substr ) ) ;
6659 }
You can’t perform that action at this time.
0 commit comments