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

Components are easy. Just write a function...

Until you want to automatically unregister event handlers when the component is removed

Until you want to compose them and select child and parent components without traversing the DOM

Until you want to pass options to the components in various ways, and have default values for them

Until you want to store component state and re-render part of the component whenever something in the state changes (since storing state in the DOM and reading it from there is bad)

Until you want to load javascript files on demand to construct and manage components instead of loading everything in one huge js file up front for a big website

Until you want to have a unified CSS convention so you can style all these components

That's when you need a well tested framework.




Are you making an argument against react or an argument against writing react in a pure functional style?

Because unless I'm very much mistaken:

ComponentWillUnmount Props Props state

for the first few complaints.

React is just the view layer, arguing against react because "you need a framework" is like arguing that no one should write their own applications without a framework. It is a separate discussion than what to use for the view rendering.


I think GP is making an argument for React by calling it the framework, whereas the OP is the "raw" component.


This this this. Why is the best comment at the bottom.


Well said Sir.




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

Search: