Skip to content

Fix edge and drop events slowing down the application #2978

Closed
@mcharfadi

Description

@mcharfadi

The events onConnectStart, onConnectEnd, onDrop, onDragOver, onNodeDrag, onNodeDragStart, onNodeDragStop should be wrapped in a useCallback to avoid unnecessary rendering.
The way we calculate drop position is costly since we're using useViewport() and that fonction is making components rerender with each change of the viewport. Since we need to have the actual viewport only when the drop is applied we should use screenToFlowPosition from ReactFlowInstance

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions