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:
parent
fbb097dc4c
commit
106a34d2ff
1 changed files with 5 additions and 1 deletions
|
|
@ -64,6 +64,10 @@ const nodeTypes = {
|
||||||
noteNode: NoteNode,
|
noteNode: NoteNode,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const edgeTypes = {
|
||||||
|
default: DefaultEdge,
|
||||||
|
};
|
||||||
|
|
||||||
export default function Page({ view }: { view?: boolean }): JSX.Element {
|
export default function Page({ view }: { view?: boolean }): JSX.Element {
|
||||||
const uploadFlow = useUploadFlow();
|
const uploadFlow = useUploadFlow();
|
||||||
const autoSaveFlow = useAutoSaveFlow();
|
const autoSaveFlow = useAutoSaveFlow();
|
||||||
|
|
@ -464,7 +468,7 @@ export default function Page({ view }: { view?: boolean }): JSX.Element {
|
||||||
onSelectionEnd={onSelectionEnd}
|
onSelectionEnd={onSelectionEnd}
|
||||||
onSelectionStart={onSelectionStart}
|
onSelectionStart={onSelectionStart}
|
||||||
connectionRadius={25}
|
connectionRadius={25}
|
||||||
edgeTypes={{ default: DefaultEdge }}
|
edgeTypes={edgeTypes}
|
||||||
connectionLineComponent={ConnectionLineComponent}
|
connectionLineComponent={ConnectionLineComponent}
|
||||||
onDragOver={onDragOver}
|
onDragOver={onDragOver}
|
||||||
onNodeDragStop={onNodeDragStop}
|
onNodeDragStop={onNodeDragStop}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue