Hacker News new | ask | show | jobs
by azangru 739 days ago
> as compared to the total uncomposability of class components

How do you mean? React components were composable from the get-go; this is practically the definition of a component: you take a piece of ui, you encapsulate it in a component, and then you can compose it with other components into more complex UIs.

Class components were reacting to component's life cycle as opposed to hooks that react to data changes; but there was nothing stopping you from extracting reusable pieces of logic into standalone functions and using them in lifecycle methods.

I thought the whole point of hooks was to support the React fiber architecture, because closures are immutable as opposed to class fields.