From 7ad02c359ae64bae28eb5b59b783c5d858cd12bc Mon Sep 17 00:00:00 2001 From: David Luzar Date: Tue, 10 Oct 2023 23:31:23 +0200 Subject: [PATCH] fix: memoize static canvas on `props.renderConfig` (#7131) --- src/components/canvases/StaticCanvas.tsx | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/components/canvases/StaticCanvas.tsx b/src/components/canvases/StaticCanvas.tsx index dfdf8b51..38b9baad 100644 --- a/src/components/canvases/StaticCanvas.tsx +++ b/src/components/canvases/StaticCanvas.tsx @@ -114,11 +114,13 @@ const areEqual = ( return false; } - return isShallowEqual( - // asserting AppState because we're being passed the whole AppState - // but resolve to only the StaticCanvas-relevant props - getRelevantAppStateProps(prevProps.appState as AppState), - getRelevantAppStateProps(nextProps.appState as AppState), + return ( + isShallowEqual( + // asserting AppState because we're being passed the whole AppState + // but resolve to only the StaticCanvas-relevant props + getRelevantAppStateProps(prevProps.appState as AppState), + getRelevantAppStateProps(nextProps.appState as AppState), + ) && isShallowEqual(prevProps.renderConfig, nextProps.renderConfig) ); };