mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-09-02 23:27:00 +02:00
perf: use UIAppState
where possible to reduce UI rerenders (#6560)
This commit is contained in:
@@ -5,9 +5,10 @@ import { ChartElements, renderSpreadsheet, Spreadsheet } from "../charts";
|
||||
import { ChartType } from "../element/types";
|
||||
import { t } from "../i18n";
|
||||
import { exportToSvg } from "../scene/export";
|
||||
import { AppState } from "../types";
|
||||
import { UIAppState } from "../types";
|
||||
import { useApp } from "./App";
|
||||
import { Dialog } from "./Dialog";
|
||||
|
||||
import "./PasteChartDialog.scss";
|
||||
|
||||
type OnInsertChart = (chartType: ChartType, elements: ChartElements) => void;
|
||||
@@ -80,9 +81,9 @@ export const PasteChartDialog = ({
|
||||
appState,
|
||||
onClose,
|
||||
}: {
|
||||
appState: AppState;
|
||||
appState: UIAppState;
|
||||
onClose: () => void;
|
||||
setAppState: React.Component<any, AppState>["setState"];
|
||||
setAppState: React.Component<any, UIAppState>["setState"];
|
||||
}) => {
|
||||
const { onInsertElements } = useApp();
|
||||
const handleClose = React.useCallback(() => {
|
||||
|
Reference in New Issue
Block a user