React 19 useActionState🔥Show Loading + Handle Form Response Easily in Next.js

React 19 useActionState🔥Show Loading + Handle Form Response Easily in Next.js

T
Thapa Technical
1 Video View·Jul 13, 2025

In this video, we solve the most common problem with the contact form in Next.js 14 using the powerful new React v19 useActionState hook and Server Actions. Learn how to handle form submission, loading states, and show success or error popups without writing extra boilerplate code. Perfect for both beginners and intermediate developers building modern full-stack apps in Next.js.

🔗 Source Code + Notes: [Insert your link here]

------------------------------------------------------------------------
🚀 Boost Your Skills with these Pre-Requisite Videos:

🔗 Best HTML Course - https://youtu.be/5ccq_nLHneE
🔗 Best CSS Course - https://youtu.be/MSICFljRcb4
🔗 JavaScript Basics Course Part 1 - https://youtu.be/13gLB6hDHR8
🔗 JavaScript Advanced Course Part 2 - https://youtu.be/YwsOCN8woA8

------------------------------------------------------------------------
💸 Build Your Own E-commerce Website for Free! - https://www.thapatechnical.com/2024/03/build-complete-ecommerce-website-using.html

------------------------------------------------------------------------
✌️ Join Us!

🚀 Become a Member: Unlock perks, free source code, and more Join Now : https://www.youtube.com/channel/UCwfaAHy4zQUb2APNOGXUCCA/join
📷 Connect on Instagram: https://www.instagram.com/thapatechnical
🗨️ Join Our Discord Server: Hang out with fellow programmers Discord Link: https://discord.gg/MdScmCsua6

------------------------------------------------------------------------

⌛TIMELINE⏳
0:00 - Problem with contact page in our Next.js app
1:45 - What is useActionState in React v19
3:50 - How to use useActionState in a client component
4:30 - Quick breakdown of the server action function
6:00 - Adding server action and initial state to the app
6:50 - Setting formAction prop on the form tag
8:00 - Showing loading animation after form submission
9:25 - Showing success or error popup after form submission
12:28 - What happens if we remove previousState
14:15 - Why we should use useActionState
14:45 - Upcoming video updates