Skip to content

The palette rerenders too much #2646

@mcharfadi

Description

@mcharfadi

Steps to reproduce

Log something in the DiagramElementPalette or DiagramPalette composant.

Expected behavior

When the palette is closed, we should not see any logs.

Actual behavior

Since we're using the useViewport(); hook, the palette re renders when the viewport changes, meaning the palette gets re rendered a lot during a move.

What to do

We should get the value of the viewport directly from the store instead of using the useViewport() hook.

  const store = useStoreApi();
 const [viewportX, viewportY, viewportZoom] = [...transform];

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions