Hacker News new | ask | show | jobs
by euoia 652 days ago
The .value thing is dreadful. Is it really necessary? I still prefer options API.
2 comments

It really is awful and smells of leaky abstraction.

Now that this is the recommended way of writing Vue, I’d be really interested in your opinion on React.

Compare the “ref” in Vue with useState hook in React.

With the useState you get back two items: the value, and a setter.

Now every time you access the value you simply access it like a variable because it is.

That's just how Proxy works in JavaScript. You might want to read a bit more about the underlying mechanism.