Using React Hook Form, Zod Validation and Server Actions in NextJs

Hamed Bahram August 17, 2023
Video Thumbnail
Hamed Bahram Logo

Hamed Bahram

@hamedbahram

About

Modern web dev topics in React and NextJs.

Video Description

In this video, we'll look at implementing forms in NextJs using the React-hook-form library, we'll then add validation using Zod, and at the end, we'll replace our API endpoint with server action. 👉🏼 The Ultimate NextJs Course 🔗 https://www.hamedbahram.io/courses/nextjs 👉🏼 Project source code (Github) 🔗 https://github.com/HamedBahram/next-rhf 👉🏼 React hook form 🔗 https://react-hook-form.com Chapters 0:00 Intro 0:40 Project code setup 1:30 Adding a simple form 5:00 Adding React hook form 13:30 Adding Zod validation 19:00 Using server actions 25:18 Outro

Instant Power on the Go

AI-recommended products based on this video

Loading...
NOCO Boost GB40: 1000A UltraSafe Jump Starter – 12V Lithium Battery Booster Pack, Portable Jump Box, Power Bank & Jumper Cables - for 6.0L Gas and 3.0L Diesel Engines
Best Seller

NOCO Boost GB40: 1000A UltraSafe Jump Starter – 12V Lithium Battery Booster Pack, Portable Jump Box, Power Bank & Jumper Cables - for 6.0L Gas and 3.0L Diesel Engines

(117,789)
$99.95$75.43
FREE delivery Sun, Sep 21
30K+ bought in past month
Loading...
Surge Protector Power Strip - CHCORE 5Ft Braided Extension Cord with 8 Outlets with 4 USB (2 USB C) Charging Ports, Flat Plug Multi Plug Outlet Extender Charging Station for Home Office, ETL, White ClimatePartner certified

Surge Protector Power Strip - CHCORE 5Ft Braided Extension Cord with 8 Outlets with 4 USB (2 USB C) Charging Ports, Flat Plug Multi Plug Outlet Extender Charging Station for Home Office, ETL, White ClimatePartner certified

(4,122)
$8.97
FREE delivery Sat, Oct 11 on $35 of items shipped by Amazon
10K+ bought in past month
Loading...
Airbrush Kit with Air Tank Compressor 2 Dual-Action Gravity Airbrush with 0.2mm 0.3mm 0.5mm Nozzle Air Compressor with Airbrush Coloring Tool Cleaning Brush for Model Paint Hobby Craft

Airbrush Kit with Air Tank Compressor 2 Dual-Action Gravity Airbrush with 0.2mm 0.3mm 0.5mm Nozzle Air Compressor with Airbrush Coloring Tool Cleaning Brush for Model Paint Hobby Craft

(32)
116.75
PrimeFREE delivery Saturday, June 14
Loading...
16/3 Black Indoor Outdoor Extension Cord 10 Ft Waterproof, Heavy Duty Extension Cord with 3 Prong Grounded Plug,13A 1625W 16AWG SJTW, Flexible Weatherproof Power Cable for Offices, Gardens and Lawns

16/3 Black Indoor Outdoor Extension Cord 10 Ft Waterproof, Heavy Duty Extension Cord with 3 Prong Grounded Plug,13A 1625W 16AWG SJTW, Flexible Weatherproof Power Cable for Offices, Gardens and Lawns

(2,229)
$6.77
FREE delivery Fri, Nov 14 on $35 of items shipped by Amazon
10K+ bought in past month
Loading...
PORTHOLIC Wii to HDMI Converter 1080P for Full HD Device, Wii HDMI Adapter with 3,5mm Audio Jack&HDMI Output Compatible with Wii, Wii U, HDTV, Monitor-Supports All Wii Display Modes 720P, NTS
Best Seller

PORTHOLIC Wii to HDMI Converter 1080P for Full HD Device, Wii HDMI Adapter with 3,5mm Audio Jack&HDMI Output Compatible with Wii, Wii U, HDTV, Monitor-Supports All Wii Display Modes 720P, NTS

(19,007)
$9.99
FREE delivery Wed, Jul 2 on $35 of items shipped by Amazon
8K+ bought in past month
Loading...
NOCO GENIUS1: 1A 6V/12V Smart Battery Charger – Automatic Maintainer, Trickle Charger & Desulfator with Overcharge Protection & Temperature Compensation – For Lead-Acid & Lithium Batteries
Best Seller

NOCO GENIUS1: 1A 6V/12V Smart Battery Charger – Automatic Maintainer, Trickle Charger & Desulfator with Overcharge Protection & Temperature Compensation – For Lead-Acid & Lithium Batteries

(57,000)
$29.95$24.03
FREE delivery Sun, Sep 21 on $35 of items shipped by Amazon
20K+ bought in past month
Loading...
Greenworks 24V 12" Cordless String Trimmer/Edger (Gen 2), 2.0Ah Battery and Charger Included

Greenworks 24V 12" Cordless String Trimmer/Edger (Gen 2), 2.0Ah Battery and Charger Included

(7,389)
79.97
PrimeFREE delivery Saturday, June 14
500+ bought in past month
Loading...
VOLTME Portable Charger, Slim 10000mAh 5V/3A Power Bank, USB C in&Out High-Speed Charging Battery Pack, Travel Essentials Dual Output Compatible with iPhone 16 15 14 13 12 Samsung Google iPad etc

VOLTME Portable Charger, Slim 10000mAh 5V/3A Power Bank, USB C in&Out High-Speed Charging Battery Pack, Travel Essentials Dual Output Compatible with iPhone 16 15 14 13 12 Samsung Google iPad etc

(51)
19.99
PrimeFREE delivery Saturday, June 14 on orders shipped by Amazon over $35
Loading...
Steelite 13.2” Electric Lawn Mower for Small Yards - 2-in-1 Compact, Lightweight Brushless Motor, 21V 4.0Ah Battery & Charger Included, Green

Steelite 13.2” Electric Lawn Mower for Small Yards - 2-in-1 Compact, Lightweight Brushless Motor, 21V 4.0Ah Battery & Charger Included, Green

(113)
139.99
FREE delivery June 13 - 16. Details
100+ bought in past month
Loading...
NOCO GENIUS1: 1A 6V/12V Smart Battery Charger – Automatic Maintainer, Trickle Charger & Desulfator with Overcharge Protection & Temperature Compensation – For Lead-Acid & Lithium Batteries
Best Seller

NOCO GENIUS1: 1A 6V/12V Smart Battery Charger – Automatic Maintainer, Trickle Charger & Desulfator with Overcharge Protection & Temperature Compensation – For Lead-Acid & Lithium Batteries

(57,000)
$29.95$24.03
FREE delivery Sun, Sep 21 on $35 of items shipped by Amazon
20K+ bought in past month