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

It's never two-way in react. You're always in charge of updating the state in the event handler, which means you know where the update came from


Not to argue semantics, but that pattern is still called two-way databinding in my neck of the woods. In this deprecated page from the official docs, two-way databinding is defined as:

> Two-way binding — implicitly enforcing that some value in the DOM is always consistent with some React state — is concise and supports a wide variety of applications.

[1] https://reactjs.org/docs/two-way-binding-helpers.html


Well, that mixin has never been the standard way and has been deprecated for years (and for good reasons)


The mixin is irrelevant to the point I was making. :) The point is that even the official React docs defines two-way binding as I describe it.




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

Search: