Module 5 Introduction

Introduction to module 5: Custom hooks

The upgrades to the Hardware Handler app are well underway now.

In our last module, we went through each class component, refactoring them to use hooks and improving the code's quality and flow thanks to ESLint.

Now, it's time to take it one step further and find instances where we're duplicating code across components, or we've got extra-large components that could do with some simplification. This type of code presents prime opportunities to be refactored into custom hooks.

This lesson preview is part of the The newline Guide to Modernizing an Enterprise React App course and can be unlocked immediately with a \newline Pro subscription or a single-time purchase. Already have access to this course? Log in here.

This video is available to students only
Unlock This Course

Get unlimited access to The newline Guide to Modernizing an Enterprise React App, plus 70+ \newline books, guides and courses with the \newline Pro subscription.

Thumbnail for the \newline course The newline Guide to Modernizing an Enterprise React App
  • [00:00 - 00:12] The upgrades to the hardware handler app are well underway now. In our last module, we went through each class component, refactoring it to use hooks, and improving the code's quality and flow thanks to ES lint.

    [00:13 - 00:28] Now it's time to take it one step further and find instances where we're dupl icating code across components, or we've got extra large components that could do with some simplification. This type of code presents prime opportunities to be refactored into custom hooks.

    [00:29 - 00:53] This module will cover identifying duplicate code across components that are good candidates to be refactored into custom hooks, simplifying large complicated components with lots of code by moving some of it out and into separate hooks, and leveraging hooks to work across multiple components, ultimately letting us delete code that becomes unnecessary . Are you ready to get even more confident with your hooks?