composition-api: `toRaw()` doesn't expose Refs like in Vue 3

It seems like toRaw() on a reactive object doesn’t expose the original properties like it does in Vue 3:

About this issue

  • Original URL
  • State: open
  • Created 3 years ago
  • Reactions: 7
  • Comments: 16 (1 by maintainers)

Most upvoted comments

I’m unsure of what the correct fix is here since Vue 2 modifies the object in place with methods like Vue.observable() (used in reactive and ref) differently from Vue 3, which creates a Proxy (reactive(obj) != obj). We could save a raw copy of the object passed to reactive() but it would require a deep copy and could have a small perf implication.

So, how to do with it?