You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If i filter or map an Array Prop which is reactive i get proxied instances not the raw results. I assume that the iterator from the reactive instance is used here so that the elements in the array get proxied.
What is expected?
Consistent behaviour of the prop. Either when accessing the prop get also proxies or get raw elements when mapping/filtering (iterating) the prop.
What is actually happening?
The prop "gives" raw objects when accessed directly but proxies if iterated.
This is the expected behavior. use toRaw to get the raw value
constdata=[{val: 1},{val: 2}]constreactiveObjs=reactive(data)// data becomes a Proxy, but the elements inside are notreactiveObjs.filter(Boolean)// the elements become Proxies
So espeacially fooProp[0] !== fooProp.filter(Boolean)[0] hit me very unexpected
Vue version
3.5.11
Link to minimal reproduction
https://play.vuejs.org/#eNqNU8tu2zAQ/BWGl0iAI/V1UmUDbpFDe0gCt7cwB1VaO3QpkiApxYWhf++SkhwliIXc9jGcGXKXR7rWOmkboBnNbWm4dsSCa/SKSV5rZRz5rmpNtkbV5DJJfeLhl19P/SMxUJSOt0C6ATcAmCyVtI5UhSvIktwf20Jk5GO3IH30qXtgMk97WRTExEGtReEAM0LyIJ2BgBqkWzLqie4/PDBKMvVnb4eKT0cLV0N9zCMPiBGRImOeTujpgjqL/rZ8l+ytkvgARy/KaImqXIC51Y6jf0YzEjq+Vwihnn6GmjMNLMZ6+Qjl3zfqe3vwNUbvDFgwLTB66rnC7MD17etfN3DA+NSsVdUIRM80N2CVaLzHHvatkRXanuCC2x9hTFzuftvrgwNpx0t5ox7ZBTyjODX/4Oeu/mz3c/IlnGOyw1ccV+KNDZrsiH/UxkF1bke0UdriklSw5RLufBYFaT/QjKyNKf4Fn+Nkb1/Vhy3JCDagdOgtHrlRG4tIPpqIoni56iUTz59suXBgokj5+sWFimO0djq8OX966mbCQiY0cwte8TYEfUjaK/uonnB9o95ywmUpmgps1KsNd4xxoVc3Sm4G8Tyd4/Hu54jewfLiljNUfmxkXZZg7TPbGL38fd1/M7KEDg==
Steps to reproduce
If i filter or map an Array Prop which is reactive i get proxied instances not the raw results. I assume that the iterator from the reactive instance is used here so that the elements in the array get proxied.
What is expected?
Consistent behaviour of the prop. Either when accessing the prop get also proxies or get raw elements when mapping/filtering (iterating) the prop.
What is actually happening?
The prop "gives" raw objects when accessed directly but proxies if iterated.
System Info
Any additional comments?
Hit this behaviour when looking up elements in an filtered prop.
The text was updated successfully, but these errors were encountered: