Skip to content

Commit 879938a

Browse files
committed
fix: type error
1 parent e3213a0 commit 879938a

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

packages/vscode-js-profile-flame/src/client/flame-graph.tsx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -170,9 +170,9 @@ export const FlameGraph: FunctionComponent<{
170170
}> = ({ columns, model, filtered }) => {
171171
const vscode = useContext(VsCodeApi) as IVscodeApi<ISerializedState>;
172172

173-
const webCanvas = useRef<HTMLCanvasElement>();
173+
const webCanvas = useRef<HTMLCanvasElement>(null);
174174
const webContext = useMemo(() => webCanvas.current?.getContext('2d'), [webCanvas.current]);
175-
const glCanvas = useRef<HTMLCanvasElement>();
175+
const glCanvas = useRef<HTMLCanvasElement>(null);
176176

177177
const windowSize = useWindowSize();
178178
const [canvasSize, setCanvasSize] = useState<ICanvasSize>({ width: 100, height: 100 });
@@ -343,8 +343,9 @@ export const FlameGraph: FunctionComponent<{
343343
return;
344344
}
345345

346-
const { width, height } = (webCanvas.current
347-
.parentElement as HTMLElement).getBoundingClientRect();
346+
const { width, height } = (
347+
webCanvas.current.parentElement as HTMLElement
348+
).getBoundingClientRect();
348349
if (width === canvasSize.width && height === canvasSize.height) {
349350
return;
350351
}

0 commit comments

Comments
 (0)