Skip to content

Commit 36a7d49

Browse files
committed
Fix compile
1 parent 018a2de commit 36a7d49

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

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)