Composition-api: portal-vue does not work with v0.6.5

Created on 21 Jun 2020  路  2Comments  路  Source: vuejs/composition-api

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

Related commits

https://github.com/vuejs/composition-api/commit/575d100 https://github.com/vuejs/composition-api/commit/1f07075

https://github.com/vuejs/composition-api/blob/2a2629e70db86a3787a4198ed45ca37534f20729/src/setup.ts#L170
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.

bug

All 2 comments

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().

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

Was this page helpful?
0 / 5 - 0 ratings