Skip to content

Commit 102a888

Browse files
authored
Memoize ConsoleLine (#827)
1 parent 4f177e6 commit 102a888

File tree

1 file changed

+3
-3
lines changed
  • src/main/frontend/pipeline-console-view/pipeline-console/main

1 file changed

+3
-3
lines changed

src/main/frontend/pipeline-console-view/pipeline-console/main/ConsoleLine.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { useEffect, useRef } from "react";
1+
import { memo, useEffect, useRef } from "react";
22

33
import { makeReactChildren, tokenizeANSIString } from "./Ansi.tsx";
44

@@ -17,7 +17,7 @@ declare global {
1717
}
1818

1919
// Console output line
20-
export const ConsoleLine = (props: ConsoleLineProps) => {
20+
export const ConsoleLine = memo(function ConsoleLine(props: ConsoleLineProps) {
2121
const ref = useRef<HTMLDivElement>(null);
2222
useEffect(() => {
2323
const height = ref.current ? ref.current.getBoundingClientRect().height : 0;
@@ -66,4 +66,4 @@ export const ConsoleLine = (props: ConsoleLineProps) => {
6666
</div>
6767
</pre>
6868
);
69-
};
69+
});

0 commit comments

Comments
 (0)