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
33 changed files with 155 additions and 125 deletions

View File

@@ -1,8 +1,9 @@
import { useExcalidrawSetAppState, useExcalidrawAppState } from "../App";
import { useExcalidrawSetAppState } from "../App";
import { SidebarTriggerProps } from "./common";
import { useUIAppState } from "../../context/ui-appState";
import clsx from "clsx";
import "./SidebarTrigger.scss";
import clsx from "clsx";
export const SidebarTrigger = ({
name,
@@ -15,8 +16,7 @@ export const SidebarTrigger = ({
style,
}: SidebarTriggerProps) => {
const setAppState = useExcalidrawSetAppState();
// TODO replace with sidebar context
const appState = useExcalidrawAppState();
const appState = useUIAppState();
return (
<label title={title}>