Shareable Custom Hooks in React
Course on egghead by Joe Previte
- 30 min
- LengthVideo runtime
- Subscription
- Price modelegghead plan
- 8
- Lessons
- 4.6
- Rating out of 545 ratings on egghead
- Oct 2019
- Published29 Oct 2019
About this course
Description from egghead
React 16.8 introduced Hooks like useState for using stateful logic in our function components, and useEffect for side effects previously only used in class-based components. The React Team has given developers a way that simplifies using core features, but what's that mean for the code that you write? In this self-paced workshop, you'll work through refactoring a component to use a custom hook, and learn to apply the patterns used by the React team to your own code. Follow the React Team's lead, and make your code more readable, reusable, and reasonable!
What it covers
8 lessons
- 1Change a Stateful React Class Component to a Function Component with the State Hook
- 2Use the React Effect Hook in Function Components
- 3Write a Custom State Hook in React
- 4Write a Custom React Effect Hook
- 5Extract a Custom Hook into its own Module with create-react-hook
- 6Test your Custom Hook Module with react-hooks-testing-library
- 7Prepare a Custom React Hook to be Published as an npm Package
- 8Publish a Custom React Hook as an npm Package
Similar React courses
Same topic, nearest in length, up to three from any one provider.
Data read from the egghead catalogue on 28 Nov 2026. How the data is collected.