Hacker News new | ask | show | jobs
by dragonwriter 1551 days ago
> React went from class to function components to hooks as preferred practices

Hooks work with function components, and are how component state and the equivalent of lifecycle methods are implemented in function components.

For a while with function components, higher-order components were a common complementary approach to hooks, which have themselves largely had their function subsumed by hooks, so you could maybe describe the trend as:

class components => function components + hooks + HOC => function components + hooks.

1 comments

That sounds right. In my own anecdotal experience I see a much bigger push to use hooks for everything, where before only useEffect and a few others would be expected.

I wish old methods would be deprecated and all features made available in function components.