top | item 41442585

(no title)

euoia | 1 year ago

The .value thing is dreadful. Is it really necessary? I still prefer options API.

discuss

order

lloydatkinson|1 year ago

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.

rty32|1 year ago

[deleted]

rty32|1 year ago

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