File tree Expand file tree Collapse file tree 3 files changed +3
-3
lines changed Expand file tree Collapse file tree 3 files changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ export const Canvas: FC = () => {
2323 } = useSimContext ( ) ;
2424 const isDragging = useRef ( false ) ;
2525 const dragStart = useRef ( { x : 0 , y : 0 } ) ;
26- const pointerCapture = useRef < number > ( ) ;
26+ const pointerCapture = useRef < number | undefined > ( undefined ) ;
2727
2828 useEffect ( ( ) => {
2929 const canvas = canvasRef . current ;
Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ export const SimContextProvider: FC<PropsWithChildren> = ({ children }) => {
1414 const [ state , dispatch ] = useReducer ( reducer , defaultState ) ;
1515
1616 // load topology
17- const canvasRef = useRef < HTMLCanvasElement > ( defaultState . graph . canvasRef . current ) ;
17+ const canvasRef = useRef < HTMLCanvasElement | null > ( defaultState . graph . canvasRef . current ) ;
1818 const resolvedState = useMemo (
1919 ( ) => ( {
2020 ...state ,
Original file line number Diff line number Diff line change @@ -104,7 +104,7 @@ export interface ISimulationIntermediateDataState {
104104}
105105
106106export interface IGraphContextState {
107- canvasRef : RefObject < HTMLCanvasElement > ;
107+ canvasRef : RefObject < HTMLCanvasElement | null > ;
108108 canvasScale : number ;
109109 canvasOffsetX : number ;
110110 canvasOffsetY : number ;
You can’t perform that action at this time.
0 commit comments