perf: use UIAppState where possible to reduce UI rerenders (#6560)

This commit is contained in:
David Luzar 2023-05-08 10:14:02 +02:00 committed by GitHub
parent 026949204d
commit 560231d365
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
33 changed files with 155 additions and 125 deletions

View file

@ -4,7 +4,7 @@ import OpenColor from "open-color";
import { Dialog } from "./Dialog";
import { t } from "../i18n";
import { AppState, LibraryItems, LibraryItem } from "../types";
import { LibraryItems, LibraryItem, UIAppState } from "../types";
import { exportToCanvas, exportToSvg } from "../packages/utils";
import {
EXPORT_DATA_TYPES,
@ -135,7 +135,7 @@ const SingleLibraryItem = ({
onRemove,
}: {
libItem: LibraryItem;
appState: AppState;
appState: UIAppState;
index: number;
onChange: (val: string, index: number) => void;
onRemove: (id: string) => void;
@ -231,7 +231,7 @@ const PublishLibrary = ({
}: {
onClose: () => void;
libraryItems: LibraryItems;
appState: AppState;
appState: UIAppState;
onSuccess: (data: {
url: string;
authorName: string;