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

Maximum update depth exceeded after value change Deep Copy problem #771

Open
MuhammedAlmaz opened this issue Oct 12, 2022 · 2 comments
Open
Assignees

Comments

@MuhammedAlmaz
Copy link

MuhammedAlmaz commented Oct 12, 2022

When value change after onValueChanged callback function, if we deep copy the new value and set this new value to value parameter of TagBox, onValueChanged function trigger infinity. How can i solve this problem? I have one global component and i'm changing the value everytime from props. Why you are not checking keys and compare two values? You can check it and if there was any diff from two value and trigger onValueChanged function. I'm pretty sure it is not really good way to check diff between two values. You guys checking only adress of the variable not arrays.

The code example here you can check.

https://codesandbox.io/s/overview-devextreme-tag-box-forked-gro4hm

If i change the line from
this.setState({ ...this.state,selectedValues: [...e.value] });
to
this.setState({ ...this.state,selectedValues: e.value });

it will work. But we are using different variables and the values address changing. So there is a big problem as i said before.

@MuhammedAlmaz
Copy link
Author

Any update for this?

@artem-kurchenko
Copy link

Hi @MuhammedAlmaz

I don't see TagBox in your example. Could you please double-check the link?

@artem-kurchenko artem-kurchenko self-assigned this Nov 8, 2022
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

No branches or pull requests

2 participants