Hacker News new | past | comments | ask | show | jobs | submit login

You are both right. React components should render based on state that is managed by React, such that the rendered output changes only if the state changes.

The complicated bit is the handling of events and changing the state. Hence why you get Redux for state but there is no “Redux for views”




React very heavily pushes "component lifecycle" events, since it was class based up until now with hooks. That is, changing the state in the view function itself.

It's not wrong, it gives you one kind of separation of concerns: components. But "the view is a function of state" is completely misleading IMO.




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

Search: