filmov
tv
Learn how to create Custom Hooks in React in 24 minutes (+ useRef Tutorial for beginners)

Показать описание
This video is designed to get you familiar with Custom Hooks in React where we cover topics such:
👉 Using a “Joke Generator” example
👉 Writing an async function to fetch data from an API
👉 Using a useEffect Hook and refactoring it to a custom hook
👉 How to use a useRef and incorporating it into the custom hook
🔴 LOOKING FOR THE CODE? 🛠️
👇🏻FOLLOW ME HERE:
💰 WANT TO SUPPORT THE CHANNEL?
🕐 TIMESTAMPS:
00:00 Intro
00:51 Skillshare Sponsorship
02:25 Introduction to Custom Hooks
02:57 Joke Generator App Example
04:21 Fetching the Joke data in a useEffect
06:01 Building the JSON Response
07:35 Storing the Response in the Component State
08:42 Building the Custom useRandomJoke Hook
12:12 Passing name as an argument in the Custom Hook
13:43 Testing our Custom Hook
14:52 Adding input fields in the Joke Generator App
17:05 Building the generateJoke Button Function
18:32 Creating the useRef Hook
22:15 Testing the Joke Generator App
22:48 Summary
23:23 Outro
Let’s get it PAPAFAM 🔥.
#reactjs #hooks #useref
Комментарии