React Hooks — Should We Be Hooked on Hooks?

My opinion on the advantages of Hooks

Gavin Macken
Level Up Coding
Published in
5 min readOct 3, 2019

--

React Hooks were introduced in React 16.8 which was released to the public on February 16, 2019. If we were to look at the Reactjs.org documents for a one-line explanation of what React Hooks are, we would be greeted with:

“ React Hooks let you use state and React lifecycle features without using class and React component lifecycle methods.”

But, they can be so much more than that…

They allow us to consider new design patterns, greater separation, and new ways to functionally program, giving us the chance to write code that's cleaner, easier to test and can approach problems from different angles.

It works quite happily alongside your existing React code and suits a gradual introduction to a platform or team. Hooks are completely opt-in and normal JS is perfectly backward compatible.

However, because of the nature of a developing environment, once you make a commitment to introducing it, other developers may be forced to pick it up during review or when revisiting code.

My personal thought…. I’m a big fan, there are no new concepts to learn per-say, it just wants to give us…

--

--