Blog Home RSS Kelvin Jackson

React Hooks Are Actually Pretty Easy


I've been diving deeper into React recently, as part of my new job, and have started using hooks regularly. I had been aware of them before, as an option that you could turn to if you really wanted to, but had always structured my code to avoid them and thus didn't learn them fluently until now.

However, after just a couple of days of working with more modern React code, I'm starting to wonder why people question their ability to use React hooks effectively. While I'm sure there are pitfalls that I haven't had a chance to run into yet, my experience so far has been that hooks are trivial to learn to use, at least if you have a basic grounding in functional programming and the more basic elements of React. There's nothing conceptually novel about them — they are mostly just a syntactic shortcut for things you've already been doing for a while, at least if you've done any serious development work with React (and probably also if you haven't).

This isn't and wasn't going to be a particularly technical post, but I wanted to write something, and this topic had been flitting around at the back of my mind for a couple of days. In summary, I would say that if you were curious about React hooks but hadn't used them, or were worried that they might be too complicated and had thus been avoiding them, you should go and give them a try. You'll probably understand most of what you need to know within a couple of hours.