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

portal-vue does not work with v0.6.5 #394

Closed
sapphi-red opened this issue Jun 21, 2020 · 2 comments · Fixed by #395
Closed

portal-vue does not work with v0.6.5 #394

sapphi-red opened this issue Jun 21, 2020 · 2 comments · Fixed by #395
Labels
bug Something isn't working

Comments

@sapphi-red
Copy link
Contributor

portal-vue does not work with v0.6.5.
Maybe related with #391.

Related commits

575d100 1f07075

return unwrapRefProxy(dataValue)

Changing this line to return dataValue makes it work.

https://github.com/LinusBorg/portal-vue/blob/39d8b3da44a975273a7804649410762817592a59/src/components/portal-target.tsx#L22
This object becomes empty after passing it to unwrapRefProxy...?

Minimal reproduction

https://codesandbox.io/s/composition-api-portal-vue-bkil6

With v0.6.4 text "Portal" appears when clicking "Toggle" button.
With v0.6.5 text does not appears.

@antfu antfu added the bug Something isn't working label Jun 21, 2020
@antfu
Copy link
Member

antfu commented Jun 21, 2020

Thanks for helping investigate. unwrapRefProxy will create a clone while portal-vue uses the same object to share data between components.

/cc @pikax I think altering the original behavior of data() might lead to confusion. Unwrapping in place doesn't sound good as well. Maybe we should revert that commit and add this to the Limitations part of README? I think it's better to discourage people to use composition apis inside data().

@pikax
Copy link
Member

pikax commented Jun 21, 2020

Probably better not to unwrap, I'm good with reverting and adding that as a limitation.

@antfu antfu mentioned this issue Jun 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants