-
-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
Effect don't work when use reactive to proxy a Map which has reactive object as member's key. #919
Comments
We only track the raw key here (line 30): and then in the Since in this instance, they key is a proxy, we call I'm not sure what the "correct" behaviour would be, though. should we always |
Why would you even add both the original and the observed version of the same object as keys in the same map? The basic rule of thumb when using v3's reactivity system is if you intend to make something reactive, create the reactive version directly and work only with the reactive version. Forget about the original.
If you somehow ran into this situation when writing normal component code, then it would better to investigate how this happened in the original scenario. |
The expected behavior is fixed, but you should still avoid having both the raw and observed versions of the same object as keys in the same map. It can lead to rather ambiguous behavior and should definitely be avoided. (a warning is added for such cases) |
Thanks for your reply, and I agree with you. It is a better way to add warning to avoid this. |
Version
3.0.0-alpha.11
Reproduction link
https://jsfiddle.net/xieyu/psavz576/51/
Steps to reproduce
With devtools opened, it obvious that the 'trigger' should be printed twice, however it just printed once.
What is expected?
The function wrap by effcet should rerun.
What is actually happening?
It lose responsiveness.
The text was updated successfully, but these errors were encountered: