Earlier quoted context omitted.
Vue3's composition api is literally a better version of hooks. Which actually answers vue2's pain points. And is strictly better than mixins. In fact, many Vue projects are using composition Api in Vue2 via a plugin because it is so good.
Just curious, but in your opinion, how does the composition API improve on React hooks? I used Vue 2 for some projects a year or two ago, and recently have been comparing React hooks & Vue's composition API. Composition is definitely better than mixins, but as a new React user, hooks are feeling more intuitive right off the bat. With Vue 3, I feel like I have to decide for every component whether to stick with the op…
I'm a fan of how Vue's composition API executes exactly once during a component lifetime (during `setup()`), whereas React hooks get set up again on every render. I find it I find Vue's approach easier to mentally model, and thus easier to write correct code (especially when doing something complicated where state changes / effect executions trigger each other). Since `setup()` is only run once, I can also do things like store non-reactive state in closure variables without wrapping those variables in hooks.