Skip to content

Commit

Permalink
fix: unnecessary re-renders in PageComponent and update edgeTypes (la…
Browse files Browse the repository at this point in the history
…ngflow-ai#3917)

fix: Update edgeTypes in PageComponent to prevent unecessary re-renders and remove console alert
  • Loading branch information
anovazzi1 authored and diogocabral committed Nov 26, 2024
1 parent f37a355 commit bfe7a55
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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}
Expand Down

0 comments on commit bfe7a55

Please sign in to comment.