mirror of
https://github.com/duckietm/Nitro-V3.git
synced 2026-06-20 07:26:19 +00:00
fix(draggable-window): pass null to useRef<HTMLDivElement> for TS6
Upstream V3.5.0 introduced a useRef<HTMLDivElement>() call with no initial value. TS6 (and the tsgo preview compiler) now require an explicit initial value for useRef typed against a DOM element. Pass null to match the React 19 RefObject<HTMLDivElement | null> shape.
This commit is contained in:
@@ -30,7 +30,7 @@ export const DraggableWindow: FC<DraggableWindowProps> = props =>
|
|||||||
const [isDragging, setIsDragging] = useState(false);
|
const [isDragging, setIsDragging] = useState(false);
|
||||||
const [isPositioned, setIsPositioned] = useState(false);
|
const [isPositioned, setIsPositioned] = useState(false);
|
||||||
const [dragHandler, setDragHandler] = useState<HTMLElement>(null);
|
const [dragHandler, setDragHandler] = useState<HTMLElement>(null);
|
||||||
const elementRef = useRef<HTMLDivElement>();
|
const elementRef = useRef<HTMLDivElement>(null);
|
||||||
const bringToTop = useCallback(() => {
|
const bringToTop = useCallback(() => {
|
||||||
let zIndex = 400;
|
let zIndex = 400;
|
||||||
for (const existingWindow of CURRENT_WINDOWS)
|
for (const existingWindow of CURRENT_WINDOWS)
|
||||||
|
|||||||
Reference in New Issue
Block a user