3 ms·
Look again; it doesn't mix presentation and (business) logic. It's all view, with the added bonus of not needing to code state transitions in the view.
by Robin_Message 10y ago
Look again; it doesn't mix presentation and (business) logic. It's all view, with the added bonus of not needing to code state transitions in the view.
- Chris_Newton 10y agoLook again; it doesn't mix presentation and (business) logic. Unfortunately, the example from the tweet really does: the storage and manipulation of the to-do list itself is right there, mixed in with the rendering component. I think it’s a bad example of how to write UI code using React, because while it’s concise and it works, the techniques it shows lack flexibility and don’t scale well, and they’re not how you’d actually write a larger app’s UI that renders using React.
- Robin_Message 10y agoTrue; I was only looking at the render method, which I think is pretty pure, and should indeed be more separated from the business logic.