-
-
Notifications
You must be signed in to change notification settings - Fork 8.5k
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
Unwrapping of deep ref in Map is not correct #9314
Comments
Hello @bergmorten
In comparison to
Accessing |
I thought the reason for not unwrapping inside map or array was a performance decision and therefor though this was an error, If this is expected behaviour then the typing is wrong (and possible documentition). The type hint says that you need foo.value (which returns undefined when executed). |
I created a PR to update the typing to infer the type of the collection value (Map, Set..) and tries to recursively unwrap it, I believe that the documentation can be more clear around this detail |
Duplicate of #8904 |
Vue version
3.3.4
Link to minimal reproduction
https://play.vuejs.org/#eNqNVNtu2kAQ/ZWRXwxSBAm8UYjURFHVSr0oifqCeVjsMWywd1d7ASrL/95Z2zh2oUleLO/MmTNnLrtF8Fmp0d5hMAvmJtZcWTBonYKMic0iCqyJgttI8FxJbaEAjSlc0ZfFlu+xhFTLHEIiCCMRiVgKY2Et5c7AokUNlhQ1CH87hCl8cTzBcLgaRmI8BoGYwGjPMvJtUWNNITMcZXIzqIiW16saQBGnDDlTN90EAg/wnanBchnG0gkbeonp4Hq4Wg0vJwImErBbbuAg9c7083r60QbtoGEbdgR0JEzekVCkUs4aIWWr5PmPwqbTlF9Qp7it5dXq1s56Cylz4qCZUpicqZv01VGeRiFQAk3z08KHJ5hy4cO7fbv3QYvqt8fyqZ8lpGJuaklUShvYduK1C5S9ouuLukA3AYLWZD7Iy+4JFi5fowazlS5LYMv22LjgEdOvucqY5bKp5Yy3K/XE/l5TyP7EcvS9ZpmRcNiiAGe42FR7zqlCZAnItB1zt24P8QuQfnz2F1ScF+N5/y2IbHUx/xu8L2c+rveK7isdLFYdQzrNE76/vfOXaQZFcbpVZQnzsfc0gHbGHtQeLqB8exuM/+0ixm3W4IreDiou5ZvRi5GCHpgiEgBREMtc8Qz1T+XHSe8LcXmP97Esk4dvlc1qh1cne7zFeHfB/mKO3hYFvzQa1DSgoPVZpqlZtfvh6Qce6b915jJxGaHfcD4iDcZVK1fB7mhqJLuDq9TSYtLTSDvzbB6OFoU5FeWFemRZ4aOAHsn7N0p/lTsdTau4SJRB+ReTY/Dz
Steps to reproduce
Run the play ground in link and see that nested ref inside Maps are unwrapped even that documentation and Typing says it should not.
ref: documentation:
https://vuejs.org/guide/essentials/reactivity-fundamentals.html#caveat-in-arrays-and-collections
What is expected?
Ref inside Map should not be unwrapped even when inside nested object.
What is actually happening?
System Info
No response
Any additional comments?
No response
The text was updated successfully, but these errors were encountered: