mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
fix: make canvas compos memoize appState on props they declare (#6897)
This commit is contained in:
parent
1bd416002c
commit
d140d1b8b3
12 changed files with 133 additions and 130 deletions
|
@ -166,7 +166,7 @@ const InteractiveCanvas = (props: InteractiveCanvasProps) => {
|
|||
|
||||
const getRelevantAppStateProps = (
|
||||
appState: AppState,
|
||||
): Omit<InteractiveCanvasAppState, "editingElement"> => ({
|
||||
): InteractiveCanvasAppState => ({
|
||||
zoom: appState.zoom,
|
||||
scrollX: appState.scrollX,
|
||||
scrollY: appState.scrollY,
|
||||
|
|
|
@ -61,13 +61,7 @@ const StaticCanvas = (props: StaticCanvasProps) => {
|
|||
|
||||
const getRelevantAppStateProps = (
|
||||
appState: AppState,
|
||||
): Omit<
|
||||
StaticCanvasAppState,
|
||||
| "editingElement"
|
||||
| "selectedElementIds"
|
||||
| "editingGroupId"
|
||||
| "frameToHighlight"
|
||||
> => ({
|
||||
): StaticCanvasAppState => ({
|
||||
zoom: appState.zoom,
|
||||
scrollX: appState.scrollX,
|
||||
scrollY: appState.scrollY,
|
||||
|
@ -84,6 +78,9 @@ const getRelevantAppStateProps = (
|
|||
selectedElementsAreBeingDragged: appState.selectedElementsAreBeingDragged,
|
||||
gridSize: appState.gridSize,
|
||||
frameRendering: appState.frameRendering,
|
||||
selectedElementIds: appState.selectedElementIds,
|
||||
frameToHighlight: appState.frameToHighlight,
|
||||
editingGroupId: appState.editingGroupId,
|
||||
});
|
||||
|
||||
const areEqual = (
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue