useState vs useRef - You’re Using the WRONG One

Опубликовано: 30 Апрель 2026
на канале: Austin Davis
2,735
160

Are you using useState when you should be using useRef (or vice versa)? In this video, we’ll break down the key differences between useState and useRef in React, show how they work under the hood, and walk through real examples so you’ll always know which one to use.

Whether you’re a beginner learning React hooks or an intermediate developer looking to avoid performance pitfalls, you’ll learn:

• The similarities between useState and useRef
• When to choose useState over useRef (and vice versa)
• How useRef can prevent unnecessary re-renders
• Real-world examples of both hooks in action

By the end, you’ll be confident choosing the right hook for the right situation—and your React code will be cleaner and faster.

📌 Timestamps:
0:00 - Similarities & Differences
9:26 - Ex 1 - Current & Previous values
15:00 - Ex 2 - Login Page
19:41 - Ex 3 - Login Page w/ user responsiveness

If you found this helpful, make sure to like, subscribe, and turn on notifications so you don’t miss future React videos!

#React #useState #useRef