News for hackers. Stuff that matters.
Re:15 years trying to make everyone separate HTML, JavaScrip... by flukus on Tuesday December 20, 2016 @01:08AM (#13217849)
Do you know of an example that does things properly? There are a lot of people here defending the code as written.
Re:15 years trying to make everyone separate HTML, JavaScrip... by Chris_Newton on Tuesday December 20, 2016 @01:35AM (#13217943)
What sort of thing did you have in mind? If you look at some of the other tools widely used in conjunction with React, the entire Redux ecosystem is about maintaining application state and systematically updating it in response to whatever events might be interesting in your system. There are libraries like Immutable.js, which like React itself is provided by Facebook, to help manage an immutable underlying data store. I imagine any decent tutorial material about using those together would provide some better examples than the contrived to-do list example from the tweet.

I’d like to repeat here that React doesn’t require that you use that particular style of architecture, and there are plenty of reasonable alternatives. However, hopefully those examples should suffice to demonstrate that separation of underlying state from UI rendering and responding to interactions makes as much sense with React as in other contexts and is widely employed in practice.