fix: unnecessary re-renders in PageComponent and update edgeTypes (#3917)

fix: Update edgeTypes in PageComponent to prevent unecessary re-renders and remove console alert
This commit is contained in:
anovazzi1 2024-09-26 08:27:10 -03:00 committed by GitHub
commit 106a34d2ff
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -64,6 +64,10 @@ const nodeTypes = {
noteNode: NoteNode,
};
const edgeTypes = {
default: DefaultEdge,
};
export default function Page({ view }: { view?: boolean }): JSX.Element {
const uploadFlow = useUploadFlow();
const autoSaveFlow = useAutoSaveFlow();
@ -464,7 +468,7 @@ export default function Page({ view }: { view?: boolean }): JSX.Element {
onSelectionEnd={onSelectionEnd}
onSelectionStart={onSelectionStart}
connectionRadius={25}
edgeTypes={{ default: DefaultEdge }}
edgeTypes={edgeTypes}
connectionLineComponent={ConnectionLineComponent}
onDragOver={onDragOver}
onNodeDragStop={onNodeDragStop}