day 73 - tried server-side validation + error handling in forms using Server Actions + useActionState() hook in Next.js15 - the hook gives you 1 form state 2 formAction(trigger) 3. isPending (boolean for loading) - basically all you need for form handling #80DaysOfNextJS

coding_robin's tweet image. day 73

- tried server-side validation + error handling in forms using Server Actions + useActionState() hook in Next.js15

- the hook gives you

1 form state

2 formAction(trigger)

3. isPending (boolean for loading) 

- basically all you need for form handling 

#80DaysOfNextJS
coding_robin's tweet image. day 73

- tried server-side validation + error handling in forms using Server Actions + useActionState() hook in Next.js15

- the hook gives you

1 form state

2 formAction(trigger)

3. isPending (boolean for loading) 

- basically all you need for form handling 

#80DaysOfNextJS
coding_robin's tweet image. day 73

- tried server-side validation + error handling in forms using Server Actions + useActionState() hook in Next.js15

- the hook gives you

1 form state

2 formAction(trigger)

3. isPending (boolean for loading) 

- basically all you need for form handling 

#80DaysOfNextJS
coding_robin's tweet image. day 73

- tried server-side validation + error handling in forms using Server Actions + useActionState() hook in Next.js15

- the hook gives you

1 form state

2 formAction(trigger)

3. isPending (boolean for loading) 

- basically all you need for form handling 

#80DaysOfNextJS

- errors are returned directly from server -> form state -> form UI -- smooth UX - tradeoff: entire form component must be marked 'use client', making it client-rendered - good trade-off? still deciding....🤔 #80DaysOfNextJS #NextJS15 #React #TypeScript


United States Trends
Loading...

Something went wrong.


Something went wrong.