Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Simplify the code to resize a node #14

Merged
merged 1 commit into from
Nov 3, 2022

Conversation

li-xin-yi
Copy link
Collaborator

Avoid passing setNodes and onRize functions when rendering nodes, which helps fix bugs when sync the nodes' info between users.

@li-xin-yi li-xin-yi requested a review from lihebi November 3, 2022 17:47
Copy link
Collaborator

@lihebi lihebi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks Xinyi!

This also seems to fix a performance issue for resizing nested nodes.

@@ -48,6 +49,25 @@ const ScopeNode = memo(({ data, id, isConnectable, selected }) => {
const [frame] = React.useState({
translate: [0, 0],
});
const { setNodes } = useReactFlow();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't know this; this is convenient.

@lihebi lihebi merged commit 4bc6cc8 into codepod-io:main Nov 3, 2022
@li-xin-yi li-xin-yi deleted the fix/resize branch December 13, 2022 22:19
lihebi added a commit to lihebi/codepod that referenced this pull request Dec 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants