Skip to content

Commit 33315d0

Browse files
committed
Fix compile
1 parent 018a2de commit 33315d0

2 files changed

Lines changed: 7 additions & 3 deletions

File tree

src/extensions/react-flow/edges/stories/EdgeDefaultV12.stories.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ const EdgeDefault = (args: Edge) => {
4444
id: args.source,
4545
type: "source",
4646
tooltip: "this is a source handle",
47-
position: Position.Left,
47+
position: Position.Right,
4848
onClick: (params) => {
4949
// eslint-disable-next-line no-console
5050
console.log("onClick source", params);
@@ -66,7 +66,7 @@ const EdgeDefault = (args: Edge) => {
6666
id: args.target,
6767
type: "target",
6868
tooltip: "this is a target handle",
69-
position: Position.Right,
69+
position: Position.Left,
7070
onClick: (params) => {
7171
// eslint-disable-next-line no-console
7272
console.log("onClick target", params);

src/extensions/react-flow/nodes/NodeContent.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -299,13 +299,17 @@ const addHandles = (
299299
});
300300
};
301301

302+
function compareStyleDirection(styleA: React.CSSProperties, styleB: React.CSSProperties, direction: string) {
303+
return styleA[direction as keyof React.CSSProperties] === styleB[direction as keyof React.CSSProperties];
304+
}
305+
302306
const MemoHandler = React.memo(
303307
(props: MemoHandlerProps) => <HandleDefault {...props} />,
304308
(prev, next) => {
305309
return (
306310
// we only test a few properties to control re-rendering
307311
// need to be extended if also other properties need to be changed late
308-
prev.style[prev.posdirection] === next.style[next.posdirection] &&
312+
compareStyleDirection(prev.style, next.style, prev.posdirection) &&
309313
prev.isConnectable === next.isConnectable &&
310314
prev.intent === next.intent &&
311315
prev.category === next.category

0 commit comments

Comments
 (0)