fix: memoize static canvas on props.renderConfig (#7131)

This commit is contained in:
David Luzar 2023-10-10 23:31:23 +02:00 committed by GitHub
parent 2523fe82e3
commit 7ad02c359a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -114,11 +114,13 @@ const areEqual = (
return false;
}
return isShallowEqual(
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)
);
};