[fix] Shape rendering (#1670)

This PR fixes shape rendering logic. Remember! memo's 2nd argument
returns "when should we NOT render" not "when should we render"

### Change Type

- [x] `patch`

### Test Plan

1. Use the draw tool
This commit is contained in:
Steve Ruiz 2023-06-29 11:13:50 +01:00 committed by GitHub
parent fd29006538
commit 81ee3381bf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -148,7 +148,7 @@ const InnerShape = React.memo(
function InnerShape<T extends TLShape>({ shape, util }: { shape: T; util: ShapeUtil<T> }) {
return useStateTracking('InnerShape:' + util.type, () => util.component(shape))
},
(prev, next) => prev.shape.props === next.shape.props || prev.shape.meta === next.shape.meta
(prev, next) => prev.shape.props === next.shape.props && prev.shape.meta === next.shape.meta
)
const InnerShapeBackground = React.memo(
@ -161,7 +161,7 @@ const InnerShapeBackground = React.memo(
}) {
return useStateTracking('InnerShape:' + util.type, () => util.backgroundComponent?.(shape))
},
(prev, next) => prev.shape.props === next.shape.props || prev.shape.meta === next.shape.meta
(prev, next) => prev.shape.props === next.shape.props && prev.shape.meta === next.shape.meta
)
const CulledShape = React.memo(