Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I find myself using `const state = reactive({...})` exclusively now. It's just way simpler (read:less mental overhead). But, I've only been using the composition API for a short while now.

Do experienced Vue devs actually use both regularly?



Personally, I rarely use refs. I think they have more use when creating general-purpose libraries for Vue.

You can also just call "toRefs()" on a "reactive()" object though.

Refs are also useful if you want to destructure a reactive object without breaking the reactivity, scroll down just below this:

https://composition-api.vuejs.org/api.html#torefs


According to the vue discord where I asked a lot of composition API questions, pretty much people use ref exclusively. It's much more explicit in your `use*` composition files when you have to call .value. It's rare to me to export a very large object of keys, and I have yet to use it yet.




Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: