File tree 1 file changed +2
-9
lines changed
packages/module/src/LogViewer
1 file changed +2
-9
lines changed Original file line number Diff line number Diff line change 1
1
import React , { memo , useContext } from 'react' ;
2
- import ReactDOMServer from 'react-dom/server' ;
3
2
import { LOGGER_LINE_NUMBER_INDEX_DELTA } from './utils/constants' ;
4
3
import { css } from '@patternfly/react-styles' ;
5
4
import styles from '@patternfly/react-styles/css/components/LogViewer/log-viewer' ;
@@ -51,16 +50,10 @@ export const LogViewerRow: React.FunctionComponent<LogViewerRowProps> = memo(({
51
50
composedString . push ( str ) ;
52
51
} else {
53
52
const splitString = str . split ( regEx ) ;
54
- splitString . forEach ( ( substr , newIndex ) => {
53
+ splitString . forEach ( ( substr ) => {
55
54
if ( substr . match ( regEx ) ) {
56
55
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>` ) ;
64
57
} else {
65
58
composedString . push ( escapeTextForHtml ( substr ) ) ;
66
59
}
You can’t perform that action at this time.
0 commit comments