Skip Main Navigation

Migrating to React Hooks Minishop

Learn how to migrate to React Hooks from classes for a better way to develop components and manage state in React applications

React is continually improving and evolving. React Hooks are a leap forward in how we develop components and manage state in our React applications. Now you can use state and other React features without having to write a class!

Many React developers have switched from classes to React Hooks and are realizing the benefits of understanding their apps better because:

  • Related logic is now located together
  • Less code is needed compared to the equivalent class
  • Function components better align with React’s mental model
  • Hooks are just awesome! 🎉

Do you have a codebase filled with class components? You could leave it that way, but it will become increasingly more “legacy” as time continues to pass by. Why not change now?

Is your team still not developing with React hooks? The longer you stick with the “old way,” the harder it will be to change when you need to. Why not change now?

Hi, I’m Ben Ilegbodu 👋🏾. In this minishop, not only will you learn the ins and outs of React Hooks, but also how to switch to React Hooks from class lifecycle methods, bringing your codebase and your team into the modern React era.

Get ready to…

  • Switch from setState to the useState hook
  • Make API calls with the useEffect hook instead of the componentDidMount, componentDidUpdate & componentWillUnmount lifecycle class methods
  • Create custom hooks to reuse and compose logic
  • Use function closures instead of this & .bind for callbacks and event handlers
  • …and many other features to help you write modern React code

You’ll need to have…

  • Prior experience building React applications specifically using classes
  • Experience with modern JavaScript syntax and asynchronous patterns like Promise & async/await

This minishop may not be for you if you…

Code of Conduct

By participating in this minishop, you are agreeing to the Minishop Code of Conduct.

What are “minishops”?

Minishops by Ben Ilegbodu are fully-remote workshops that last about 3 hours. They’re highly-focused, covering only the concepts you want to learn so that you can level up your skills and get on with the rest of your day. By keeping it short, you’re able to absorb and retain the information before fatigue sets in and other distractions get in your way.

To learn more about minishops, read the Introducing Minishops blog post.