-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix: Edges not changing on change in position of node handles
- Loading branch information
1 parent
368bc8c
commit 91683b8
Showing
5 changed files
with
159 additions
and
114 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import React, { useEffect } from "react"; | ||
import { Handle, Position, useUpdateNodeInternals } from "reactflow"; | ||
|
||
const CustomHandle = ({ nodeId, type, position, style }: any) => { | ||
const updateNodeInternals = useUpdateNodeInternals(); | ||
useEffect(() => { | ||
updateNodeInternals(nodeId); | ||
}, [position]); | ||
return ( | ||
<Handle | ||
type={type} | ||
position={position} | ||
style={{ | ||
...style, | ||
}} | ||
/> | ||
); | ||
}; | ||
|
||
export default CustomHandle; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters