File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed
packages/vscode-js-profile-flame/src/client Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -170,9 +170,9 @@ export const FlameGraph: FunctionComponent<{
170
170
} > = ( { columns, model, filtered } ) => {
171
171
const vscode = useContext ( VsCodeApi ) as IVscodeApi < ISerializedState > ;
172
172
173
- const webCanvas = useRef < HTMLCanvasElement > ( ) ;
173
+ const webCanvas = useRef < HTMLCanvasElement > ( null ) ;
174
174
const webContext = useMemo ( ( ) => webCanvas . current ?. getContext ( '2d' ) , [ webCanvas . current ] ) ;
175
- const glCanvas = useRef < HTMLCanvasElement > ( ) ;
175
+ const glCanvas = useRef < HTMLCanvasElement > ( null ) ;
176
176
177
177
const windowSize = useWindowSize ( ) ;
178
178
const [ canvasSize , setCanvasSize ] = useState < ICanvasSize > ( { width : 100 , height : 100 } ) ;
@@ -343,8 +343,9 @@ export const FlameGraph: FunctionComponent<{
343
343
return ;
344
344
}
345
345
346
- const { width, height } = ( webCanvas . current
347
- . parentElement as HTMLElement ) . getBoundingClientRect ( ) ;
346
+ const { width, height } = (
347
+ webCanvas . current . parentElement as HTMLElement
348
+ ) . getBoundingClientRect ( ) ;
348
349
if ( width === canvasSize . width && height === canvasSize . height ) {
349
350
return ;
350
351
}
You can’t perform that action at this time.
0 commit comments