DanFromUkraine / portfolio

https://portfolio-danfromukraines-projects.vercel.app
0 stars 0 forks source link

Fix type error in RenderCube ref useRef reference #2

Closed DanFromUkraine closed 3 hours ago

DanFromUkraine commented 3 hours ago

Type 'MutableRefObject' is not assignable to type 'LegacyRef | undefined'. Type 'MutableRefObject' is not assignable to type 'RefObject'. Types of property 'current' are incompatible. Type 'undefined' is not assignable to type 'HTMLSpanElement | null'.ts(2322) index.d.ts(303, 9): The expected type comes from property 'ref' which is declared here on type 'DetailedHTMLProps<HTMLAttributes, HTMLSpanElement>'

DanFromUkraine commented 3 hours ago

It was enaugh to set null as an initial value for useRef