Become a member
to unlock all features

Level Up!

Access all courses & lessons on egghead today and lock-in your price for life.


    Create a Custom Hook in React by Wrapping useState


    Custom hooks in React are functions, and we can write them by combining other, preexisting hooks.

    In this lesson, we'll wrap the useState React hook to create a hook that automatically pulls out the event.target.value of an input's onChange callback. We'll then use that hook directly as the onChange prop of a text input.