Congrats on finishing the Custom Hooks lesson! In this lesson, we reviewed how the useState() and the useEffect() hooks work. We have also covered the rules that hooks are governed by. The rules of hooks apply to both built-in hooks as well as any custom hooks that we create.

Custom hooks are JavaScript functions that make use of other hooks. Their names all begin with use but otherwise can be designed as the developer sees fit. Custom hooks are useful for encapsulating complex and repetitive hook logic and are often created in their own file and exported for maximum portability.


If you would like to learn more, check out the React.js documentation on hooks and custom hooks!

Sign up to start coding

Mini Info Outline Icon
By signing up for Codecademy, you agree to Codecademy's Terms of Service & Privacy Policy.

Or sign up using:

Already have an account?