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

Empty reactive object doesn't have reactivity for new keys #580

Closed
roman0x58 opened this issue Oct 30, 2020 · 5 comments
Closed

Empty reactive object doesn't have reactivity for new keys #580

roman0x58 opened this issue Oct 30, 2020 · 5 comments
Labels
bug Something isn't working no-issue-activity

Comments

@roman0x58
Copy link

Hi everyone! I'm using latest vue2 + composition-api (beta18) and I have an empty reactivity object in my component :

const obj = reactive({})

later I set new props to this object using set :

set(obj, prop, value)

this should trigger changes and I'm expecting that my view will refresh, but it doesn't. So If I replace reactive by ref({}) or initialize the reactive object with the prop it does work as expected.

sandbox example : https://codesandbox.io/s/late-river-lmze9

@hyf0
Copy link
Contributor

hyf0 commented May 27, 2021

fixed in #692 . @antfu maybe closes this one?

@tminich
Copy link

tminich commented Sep 3, 2021

It still doesn't work correctly, at least not in computed. del seems to work (first click on 'Set by computed'), but set doesn't.
https://codesandbox.io/s/funny-agnesi-wr6i5

@github-actions
Copy link

github-actions bot commented Nov 2, 2021

Stale issue message

@shrpne
Copy link

shrpne commented May 23, 2022

@arielkuzminski
Copy link

Anybody got a solution for this? I need to create refs dynamically on the runtime (I don't know how much theres gonna be or how they are gonna be named). And then I need to do some filtering to them on user demand, and return still as reactive object so they affect original object.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working no-issue-activity
Projects
None yet
Development

No branches or pull requests

6 participants