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

toRaw does not undo props auto unwrapping #392

Closed
vmihailenco opened this issue Jun 21, 2020 · 2 comments · Fixed by #409
Closed

toRaw does not undo props auto unwrapping #392

vmihailenco opened this issue Jun 21, 2020 · 2 comments · Fixed by #409
Assignees
Labels
bug Something isn't working has PR

Comments

@vmihailenco
Copy link

composition-api v0.6.5 toRaw does not unwrap reactive:

toRaw(reactive({ "ref": ref(1) }))

In vue-next same code works as expected.

@antfu
Copy link
Member

antfu commented Jun 21, 2020

It seems to work for me: https://codepen.io/antfu/pen/zYrZdbQ

Can you share a reproduce demo?

@antfu antfu added the needs reproduction We need a runnable reproduction from the OP label Jun 21, 2020
@vmihailenco
Copy link
Author

vmihailenco commented Jun 22, 2020

Looks like the problem is with props auto unwrapping - https://codepen.io/vmihailenco/pen/wvMJxYB

@vmihailenco vmihailenco changed the title toRaw(reactive(target)) should return target toRaw does not undo props auto unwrapping Jun 22, 2020
@antfu antfu added bug Something isn't working and removed needs reproduction We need a runnable reproduction from the OP labels Jun 22, 2020
@antfu antfu self-assigned this Jun 22, 2020
antfu added a commit to antfu/composition-api that referenced this issue Jun 25, 2020
@antfu antfu added the has PR label Jun 28, 2020
antfu added a commit that referenced this issue Jun 30, 2020
* fix(unwrapRef): copy __ob__ and make toRaw work when passing via props, fix #392

* fix
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working has PR
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants