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

reactive and ref type infer is Wrong #1111

Closed
shaonialife opened this issue May 4, 2020 · 1 comment
Closed

reactive and ref type infer is Wrong #1111

shaonialife opened this issue May 4, 2020 · 1 comment
Labels
🐞 bug Something isn't working scope: reactivity

Comments

@shaonialife
Copy link

Version

3.0.0-beta.7

Reproduction link

https://github.com/shaonialife/vue-next-test

Steps to reproduce

const state = reactive({
  foo: {
    value: 1,
    label: 'bar',
  },
});

console.log(state.foo.label); // Property 'label' does not exist on type 'number'

What is expected?

no lint error

What is actually happening?

Property 'label' does not exist on type 'number'


ref has same problem

@LinusBorg LinusBorg added 🐞 bug Something isn't working scope: reactivity labels May 4, 2020
@LinusBorg
Copy link
Member

Seems it interprets the foo object as a ref because of the value property. If it's renamed, it doesn't happen anymore.

That problem has been fixed before, Ref's have a special marker attribute to prevent that from happening.

Thanks for reporting, we'll look into it!

LinusBorg referenced this issue May 4, 2020
WeakSets and WeakMaps shows degrading performance as the amount of
observed objects increases. Using hidden keys result in better
performance especially when repeatedly creating large amounts of
reactive proxies.

This also makes it possible to more efficiently declare non-reactive
objects in userland.
@github-actions github-actions bot locked and limited conversation to collaborators Nov 13, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
🐞 bug Something isn't working scope: reactivity
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants