chore: upgrade to react@19 (#9182)

This commit is contained in:
David Luzar 2025-02-25 19:18:42 +01:00 committed by GitHub
parent 9ee0b8ffcb
commit 31e8476c78
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
58 changed files with 2774 additions and 2828 deletions

View file

@ -1,4 +1,5 @@
import { forwardRef } from "react";
import type { JSX } from "react";
import clsx from "clsx";
import "./ButtonIcon.scss";

View file

@ -1,3 +1,4 @@
import type { JSX } from "react";
import clsx from "clsx";
export const ButtonIconCycle = <T extends any>({

View file

@ -1,3 +1,4 @@
import type { JSX } from "react";
import clsx from "clsx";
import { ButtonIcon } from "./ButtonIcon";

View file

@ -1,3 +1,4 @@
import type { JSX } from "react";
import React, {
useMemo,
useState,

View file

@ -4,7 +4,7 @@ import { type FontDescriptor } from "./FontPickerList";
interface FontPickerKeyNavHandlerProps {
event: React.KeyboardEvent<HTMLDivElement>;
inputRef: React.RefObject<HTMLInputElement>;
inputRef: React.RefObject<HTMLInputElement | null>;
hoveredFont: Node<FontDescriptor> | undefined;
filteredFonts: Node<FontDescriptor>[];
onClose: () => void;

View file

@ -1,3 +1,4 @@
import type { JSX } from "react";
import React from "react";
import { t } from "../i18n";
import { KEYS } from "../keys";

View file

@ -1,3 +1,4 @@
import type { JSX } from "react";
import React, { useEffect } from "react";
import * as Popover from "@radix-ui/react-popover";
import { isArrowKey, KEYS } from "../keys";

View file

@ -1,8 +1,9 @@
import "./ToolIcon.scss";
import type { JSX } from "react";
import clsx from "clsx";
import type { ToolButtonSize } from "./ToolButton";
import "./ToolIcon.scss";
const DEFAULT_SIZE: ToolButtonSize = "small";
export const ElementCanvasButton = (props: {

View file

@ -1,3 +1,4 @@
import type { JSX } from "react";
import React from "react";
import type {
AppClassProperties,

View file

@ -1,3 +1,4 @@
import type { JSX } from "react";
import React from "react";
import type { AppState, SidebarName, SidebarTabName } from "../../types";

View file

@ -10,7 +10,6 @@ type StackProps = {
justifyContent?: "center" | "space-around" | "space-between";
className?: string | boolean;
style?: React.CSSProperties;
ref: React.RefObject<HTMLDivElement>;
};
const RowStack = forwardRef(

View file

@ -13,7 +13,7 @@ const ErrorComp = ({ error }: { error: string }) => {
interface TTDDialogOutputProps {
error: Error | null;
canvasRef: React.RefObject<HTMLDivElement>;
canvasRef: React.RefObject<HTMLDivElement | null>;
loaded: boolean;
}

View file

@ -1,3 +1,4 @@
import type { JSX } from "react";
import type { ReactNode } from "react";
import { useTunnels } from "../../context/tunnels";
import DropdownMenu from "../dropdownMenu/DropdownMenu";

View file

@ -12,7 +12,7 @@ const resetPreview = ({
canvasRef,
setError,
}: {
canvasRef: React.RefObject<HTMLDivElement>;
canvasRef: React.RefObject<HTMLDivElement | null>;
setError: (error: Error | null) => void;
}) => {
const canvasNode = canvasRef.current;
@ -40,7 +40,7 @@ export interface MermaidToExcalidrawLibProps {
}
interface ConvertMermaidToExcalidrawFormatProps {
canvasRef: React.RefObject<HTMLDivElement>;
canvasRef: React.RefObject<HTMLDivElement | null>;
mermaidToExcalidrawLib: MermaidToExcalidrawLibProps;
mermaidDefinition: string;
setError: (error: Error | null) => void;

View file

@ -17,7 +17,7 @@ import { isRenderThrottlingEnabled } from "../../reactUtils";
import { renderInteractiveScene } from "../../renderer/interactiveScene";
type InteractiveCanvasProps = {
containerRef: React.RefObject<HTMLDivElement>;
containerRef: React.RefObject<HTMLDivElement | null>;
canvas: HTMLCanvasElement | null;
elementsMap: RenderableElementsMap;
visibleElements: readonly NonDeletedExcalidrawElement[];

View file

@ -1,3 +1,4 @@
import type { JSX } from "react";
import React, { useEffect, useRef } from "react";
import {
getDropdownMenuItemClassName,

View file

@ -1,3 +1,4 @@
import type { JSX } from "react";
import { useDevice } from "../App";
const MenuItemContent = ({

View file

@ -1,4 +1,5 @@
import MenuItemContent from "./DropdownMenuItemContent";
import type { JSX } from "react";
import React from "react";
import {
getDropdownMenuItemClassName,

View file

@ -1,3 +1,4 @@
import type { JSX } from "react";
import { actionLoadScene, actionShortcuts } from "../../actions";
import { getShortcutFromShortcutName } from "../../actions/shortcuts";
import { t, useI18n } from "../../i18n";