By the way. One really important thing is that a server action in the end is an api endpoint which is unsafe. So whenever you use a server action it should be checked whether the user is authorized to perform the action.
This was great, I always found it hard to wrap my head around the useTransition hook in a standard client side app with React Query powering most of it, but the useOptimistic and useActionState hooks seem to be great patterns. Can't wait to see how form libraries leverage this
By the way. One really important thing is that a server action in the end is an api endpoint which is unsafe. So whenever you use a server action it should be checked whether the user is authorized to perform the action.
Absolutely!
This was great, I always found it hard to wrap my head around the useTransition hook in a standard client side app with React Query powering most of it, but the useOptimistic and useActionState hooks seem to be great patterns. Can't wait to see how form libraries leverage this
Glad it was helpful!
Thank you for being such an amazing teacher 🙏
My pleasure!
I just found next-safe-action which seems to take this concept even a step further.
I'll check it out.
There are 2 good videos from dave gray
or zsa
Kept it super simple and understandable. I now get it! Thanks.
Great to hear!
Is this code available somewhere?
I don't think so, I'll ask Sam.