News for hackers. Stuff that matters.
Re:How Does React Tell a Class from a Function? by masklinn on Monday December 03, 2018 @06:59AM (#18588087)
> What's the rationale for allowing the components to be defined as functions in the first place?

Intent: it makes clear that the component is stateless in a way a class-based component does not.

Re:How Does React Tell a Class from a Function? by hoppelhase on Monday December 03, 2018 @07:55AM (#18588357)
This is why I don't like the hooks concept introduced in the post. It breaks these semantics.
Re:How Does React Tell a Class from a Function? by econnors on Monday December 03, 2018 @08:44AM (#18588655)
These semantics didn’t exist, anyway. Functional components can hold state through higher order components (eg connected to redux store), render props of children components, etc.