Building with React 19 (actions + useOptimistic)

preview_player
Показать описание

Рекомендации по теме
Комментарии
Автор

Thanks a lot, Lee, for enlightening these new features :)

andmal
Автор

The company I work for already invested on server actions, today I just moved a whole module to server actions and it just took 3 days. Its nice VERY NICEEEE !!!

rudrava
Автор

You did my day. I really had LOL when you showed Remix t-short :D

sbogdaniuk
Автор

Thanks Lee. I have a question though: Server actions are great when working with a website-as-a-whole approach, but we use separate APIs and website approach. I find authentication to an external API very difficult when working with Next.js server side. NextAuth doesn't even work very well when having to authenticate against an external system and then use THOSE tokens the external system gives you to make subsequent calls, because it generates it's own JWT's which aren't reconcilable. Any chance you'd talk about something like this?

snivels
Автор

Very cool! I’m curious about authentication, though. Why don’t you recommend handling it in middleware? Wouldn't it be more convenient to have the authentication logic (e.g., "if (session) do this, if not do that") in one place instead of in every server action? Even with a HOC, you still need to wrap each action, which seems to add coupling. Thanks!

boombang
Автор

How do handle multiple CRUD operations using the use optimistic hook. For example optimistic remove todo, add todo etc on the same shared state? Can the hook achieve that?

moggedau