I don't really see the point of useActionState, I mean what am I benefiting from using action instead the onsubmit event? Weren't we moving to apis so that we could have backend client agnostic? Aren't we just going back to old way of doing it with PHP? I don't know what I am not understanding and would love someone to explain and convince me that this is worth it
Thanks for good video, but to be honest, it seems to me that React took a wrong turn: These new features and hooks solve problems that essentially do not exist in modern development It also look very inappropriate from the point of view of HTML elements: it’s strange that I’m passing some function to the action field that has nothing to do with how the action field of a form element is processed in HTML
@@tuannguyenanh7466 yes svelte is very cool , very easy to understand and very flexible . But doesn’t pay the bills sadly . That’s why most people stick with react and next js ..
what if we need both web and a mobile app with an api wont this approach just cause overhead, i mean how can we approach if we want to serve both web and mobile app???
Thanks . Helpful videos as always . Do you plain any long video of building full project with crud using pgsql prisma and next 15 or react 19 ? That would be huge
Just to understand, now that we can use server side actions in React without next.js, we need to host react on any server, i.e bundled with vite? No more vercel? Or it seems like you are showing this example in next.js and server-side actions won't work without supporting framework like next.js
Hi, useState is meant to store some state in the client. useOptimistic is meant to store some state that is synced with some value on your server, and updates even before your server gives an answer. For example, imagine you have a social media app where you have a like button with a likes counter. You can have you likes be handled with the useOptimistic hook, and when you click it, it will instantly increment the like and send the POST request to the server. After some time, when the server responds, if it responds with an OK status, nothing will happen, but if it responds with an error, the useOptimistic hook will automatically roll back the like count to the value that it had before you clicked the button. Hope this helped :)
What if there is a network or server issue where the action was not even hit? For example, what if the host throws something like a 413 status for body size too much or a rate limit? How does the client get this status code?
Hi, it does not. Even though react has all of this server features built in now, they are meant to be used by Framework and Library authors, your react app will not have this feautures by default. I might be wrong, but I think you can have these features by serving your react app on an Express server. Don't quote me on that though 'cause I haven't done research on the topic. I hope this helps :)
@@afonsopimenta You can use server component on basic CRA app. Framework is just for convenience. They should never be the only way you can do something
@@User948Z7Z-w7n Are you sure? Can you show me a repository where that is that case? I believe I read somewhere that you could not, but I might be wrong so, if you could show me one that would be great :) Always up for some learning
NEXT15 - If you want the react compiler you would have to sacrafice the existing rust compiler in nextjs, unless your app is really slow and needs it, don't do it as of now.
Very professional, I like this guy more than other tubers
I don't really see the point of useActionState,
I mean what am I benefiting from using action instead the onsubmit event?
Weren't we moving to apis so that we could have backend client agnostic?
Aren't we just going back to old way of doing it with PHP?
I don't know what I am not understanding and would love someone to explain and convince me that this is worth it
Thanks for good video, but to be honest, it seems to me that React took a wrong turn:
These new features and hooks solve problems that essentially do not exist in modern development
It also look very inappropriate from the point of view of HTML elements: it’s strange that I’m passing some function to the action field that has nothing to do with how the action field of a form element is processed in HTML
Thank you for the video
Head over Svelte, it has server and client explicitly, which is easier to understand than a React
@@tuannguyenanh7466 yes svelte is very cool , very easy to understand and very flexible . But doesn’t pay the bills sadly . That’s why most people stick with react and next js ..
Thanks for all the info and content 🙂
Very nice. Thanks
Love your content.
great content!
what if we need both web and a mobile app with an api wont this approach just cause overhead, i mean how can we approach if we want to serve both web and mobile app???
Thanks . Helpful videos as always . Do you plain any long video of building full project with crud using pgsql prisma and next 15 or react 19 ? That would be huge
Great idea
@ you the goat 🫡
Just to understand, now that we can use server side actions in React without next.js, we need to host react on any server, i.e bundled with vite? No more vercel? Or it seems like you are showing this example in next.js and server-side actions won't work without supporting framework like next.js
So whats the difference between usestate and useoptimistic??
Hi, useState is meant to store some state in the client.
useOptimistic is meant to store some state that is synced with some value on your server, and updates even before your server gives an answer.
For example, imagine you have a social media app where you have a like button with a likes counter. You can have you likes be handled with the useOptimistic hook, and when you click it, it will instantly increment the like and send the POST request to the server. After some time, when the server responds, if it responds with an OK status, nothing will happen, but if it responds with an error, the useOptimistic hook will automatically roll back the like count to the value that it had before you clicked the button.
Hope this helped :)
@@afonsopimenta appreciated
@@afonsopimenta what's the use?
not much, it rolls back automatically to previous value on error, with useState u would have to handle it manually
i tried to use form Action. Not sure why the server action is a get call.
Nice video, but think React Compile is not enabled because still under construction. You need enable it in NextJS
Кайф, огонь. Обязательно надо попробовать. Я так давно хотел чего-нибудь нового, и вот оно пришло
tip: if you're trying to show how a bit of js code works, remove the multiline classNames which dominate the screen
Yeah, I think there is a vs code extension exactly for this purpose, which helps to hide the classes inside className with a three dot.
Name of extension?
@@its4zahoor Tailwind Fold
@@hooooman.amazing thank you
I wonder why they did not talk about React Compiler when React 19 was released few days ago
Because its still in beta
need next js 15 full coures
Hi Wesley. Does "NEW React & Next.js" course cover Next.js 15?
What if there is a network or server issue where the action was not even hit?
For example, what if the host throws something like a 413 status for body size too much or a rate limit? How does the client get this status code?
You handle it the same way you would handle a fetch call.
Thank God for no more forwardRef
so create-react-app now will come with a server?
Server means your terminal lol. Unless you deploy to some services or have your own server
Hi, it does not.
Even though react has all of this server features built in now, they are meant to be used by Framework and Library authors, your react app will not have this feautures by default.
I might be wrong, but I think you can have these features by serving your react app on an Express server. Don't quote me on that though 'cause I haven't done research on the topic.
I hope this helps :)
create-react-app is deprecated and not maintained. React now recommends using a framework of your choice
@@afonsopimenta You can use server component on basic CRA app. Framework is just for convenience. They should never be the only way you can do something
@@User948Z7Z-w7n Are you sure? Can you show me a repository where that is that case?
I believe I read somewhere that you could not, but I might be wrong so, if you could show me one that would be great :)
Always up for some learning
So what changed since the release candidate?
OMG! OMG!!! OMFG!!! I can't believe this! I refuse to believe it. It is INCREDIBLE!!! Why did they have to change this??? Why???Oh ,...no nooooo!!!
This is next Theo video title?
does it mean we can ditch the ridiculous nextjs forever from now? 😂
react Library slowly become react framework
imagine you drop 19 versions and still garbage takes some skill
It's incredible that guys think that React or Vercel "created" a thing that is already built in on HTML + Ajax
Use not for accessing context. Use is for resolving promises.
You can use use (pun intended) for both :)
No actually. It can be used for both.
NEXT15 - If you want the react compiler you would have to sacrafice the existing rust compiler in nextjs, unless your app is really slow and needs it, don't do it as of now.
Most apps anyways are fast anyways
Please slow down a bit. So hard to follow. I can give few more mins to watch the video.
0.75x
@@its4zahoor My comment is for him, not you.