As a beginner, I can say that reading the Nextjs docs is overwhelming but when they get explained - like you did. It makes perfect sense.
@brettwestwooddeveloper11 ай бұрын
Thank you so much! I tried my best to explain it
@creciendotech9 ай бұрын
This is the best explanation I have watched so far, you have earned a new subscriber. Thanks!
@brettwestwooddeveloper9 ай бұрын
Awesome! Thank you! Glad I could help you out!
@TribhuwanKushwaha-e7y11 ай бұрын
Hi this tutorial is really explanatory and can be understand well than other video on the same topic. There is a miner suggestion i want to add that it will be more beneficial to have a get or fetch data actions too.
@TypeScriptTV4 ай бұрын
Very nice and concise tutorial! I learned a lot from it. 👍
@brettwestwooddeveloper4 ай бұрын
Thanks! Glad it was helpful!
@belgi76 Жыл бұрын
Perfect explanation about the server actions.
@brettwestwooddeveloper Жыл бұрын
Thank you!
@ashimov19709 ай бұрын
God bless, Brett
@brettwestwooddeveloper9 ай бұрын
Thank you!
@enz1222 Жыл бұрын
Never seen a better explanation than this 💯
@muneeburrehman54710 ай бұрын
very useful and explained in super easy way. Much appreciated!
@fahdfady6632 Жыл бұрын
Amazing, it all makes sense now.
@brettwestwooddeveloper Жыл бұрын
Awesome! Glad I could help you out!
@prashlovessamosa Жыл бұрын
Thanks for sharing Brett.
@brettwestwooddeveloper Жыл бұрын
You are welcome!
@dev-akeel Жыл бұрын
Sharing is caring. But when I shared something with Brett. Bro got angry at me and is not talking to me now😢
@merakli2022 Жыл бұрын
Well done. Keep up the good work!
@brettwestwooddeveloper Жыл бұрын
Thanks, will do!
@ekchills6948 Жыл бұрын
You always know what we need
@brettwestwooddeveloper Жыл бұрын
Glad I could read your mind
@dev-akeel Жыл бұрын
I found my friend the best in the word and while sharing the best thing with him he stopped talking to me and now😢
@skverskk8 ай бұрын
Wow. You explained it all. Thx
@brettwestwooddeveloper8 ай бұрын
No problem! Thanks for watching my content!
@SriramPrasanth-n9c9 ай бұрын
Good Video Awesome Explanation
@brettwestwooddeveloper9 ай бұрын
Thank you!
@jpisty11 ай бұрын
Thank you so much. Been struggling with the App router
@brettwestwooddeveloper11 ай бұрын
No problem! Glad I was able to help you out!
@NOTHING-en2ue Жыл бұрын
now i really understand the server-actions, very well tutorial thanks a lot ❤
@brettwestwooddeveloper Жыл бұрын
No problem! Thank you for watching!
@HeroKiller-rh6vx11 ай бұрын
Great video thanks man!
@brettwestwooddeveloper11 ай бұрын
Thank you!
@meilyn22 Жыл бұрын
Best explanation hands down!
@brettwestwooddeveloper Жыл бұрын
Thank you so much!
@dev-akeel Жыл бұрын
I have no experience explaining anything 😢 so I lost my friend while explaining him something really very important.
@satvik0099 Жыл бұрын
Your explanations are always awesome. Just waiting for some full-stack videos from you 😁
@brettwestwooddeveloper Жыл бұрын
Glad you like them! Should be coming soon
@SteelCityEndurance11 ай бұрын
Hi, this is pretty straightforward but in the end your writing a function that accesses the database. If you write an API, you can reuse the endpoint as needed. aside from not exposing the POST to the client side how does this benefit the developer ? You're writing the function either way, right?
@whezboo10 ай бұрын
Hi there! Firstly, thank you so much for the informative video on server actions. I've learned a lot from it! I just noticed in the code on page.tsx, there's an unused addExpense function. Since we've already separated the form into its own component and created a dedicated action for server interactions, it seems like this function isn't necessary anymore. Perhaps we could consider removing or commenting out this function to avoid confusion and keep our codebase clean. Just a suggestion to streamline things further! Thanks again for the awesome tutorial! Looking forward to more content from you. 😊
@brettwestwooddeveloper10 ай бұрын
No problem! Thanks for the support and appreciate the feedback!
@dawid_dahl Жыл бұрын
Great explanation. Thank you!
@brettwestwooddeveloper Жыл бұрын
Glad it was helpful! No problem!
@lukyno575111 ай бұрын
Really good video!!! Thx
@brettwestwooddeveloper10 ай бұрын
Thank you and no problem!
@whatdorin Жыл бұрын
What extension do I need to use for function autocomplete suggestion like you have here? 2:58
@brettwestwooddeveloper Жыл бұрын
Github Copilot. It does cost a monthly fee of like $10/mo
@ayushshende4290 Жыл бұрын
How can we use server actions client side but outside of form tags, let's say I don't have any input form like calling a server action on click of a add to cart button, and also how to show loading state in that.
@brettwestwooddeveloper Жыл бұрын
I recommend using API routes instead of server functions for that and only way to show loading state is with client side code. You will have to refactor code to suit your case
@YuuffyLIVE9 ай бұрын
Hey Brett, awesome Video. How do we go about using server actions for calling external APIs where we have to authenticate ourself with headers (using clientid,secret). Do we just use fetch or can we use external libraries like axios inside server actions? In a lot of explanations we use forms and call our own database using ORMs like prisma, but never external apis. Another thing (more directed towards server components) is that it is often very confusing switching from one to another and use them simultaneously, when you can only use states inside client components or async/await inside server components.
@heddshot87 Жыл бұрын
You don't have to place the cursor on the far right to make a new line, just hold ctrl and enter, you can be anywhere on the line. Same goes for new line above with ctrl+shift+enter. 😊
@brettwestwooddeveloper Жыл бұрын
Thank you for the tip, will definitely have to get use to it
@hr94op4 ай бұрын
Man, thanks!
@brettwestwooddeveloper4 ай бұрын
You are welcome!
@blahblahblah-u3m11 ай бұрын
Appreciated. 0:14
@ChrisHaupt Жыл бұрын
prisMA!! thanks for the video
@brettwestwooddeveloper Жыл бұрын
No problem!
@BobbyCatesby Жыл бұрын
What setting or extension do you have enabled to see the vertical ruler on the side, showing opening and closing of divs?
@kenscode8 ай бұрын
Great video! I am having trouble finding a resource on how to redirect the user to another page after submitting to the database inside a server action. My code is similar to yours but I have a form with a lot of fields. redirect() says it works but isn't working inside a try/catch block and outside of the block says it's unreachable code 😬
@AbdulRauf-n8o Жыл бұрын
Thanks for this great tutorial. I have a question. Can't we fetch data by using server actions without forms like we do GET request using api route?
@brettwestwooddeveloper Жыл бұрын
Thanks for watching! And I think you can only user server actions on forms for data mutations. If you want to perform a GET request then you should just use a route handler.
@sagesofsound29811 ай бұрын
I wish there was a way to sort of see the cache working in action. Like with react query. Right now we just sort of assume everything works and is safe.
@brettwestwooddeveloper10 ай бұрын
Yea that would be pretty cool but I guess you can test it out by adding new data and make sure you are fetching data by caching and see if the data updates or not
@Sfeclicel2 ай бұрын
How do you handle errors or server side validation?
@brettwestwooddeveloper2 ай бұрын
You can use a package like ZSA which does server side validation. There are other ways as well
@usmanshahid1557 Жыл бұрын
Good work
@brettwestwooddeveloper Жыл бұрын
Thank you
@rockbotico Жыл бұрын
Thanks for sharing!. I have a question. Why does the title text flash when you add the school supplies? Edit: I found the answer in a github discussion, "I just noticed that the jitter is only there in dev mode. After building the project, it's gone."
@brettwestwooddeveloper Жыл бұрын
No problem! Thanks for the sub!
@ItsLeonardoGranetto10 ай бұрын
I haven't found anything about this in the docs, but can you actually access the request object?
@brettwestwooddeveloper10 ай бұрын
Very nice. Good to know
@nicolascondrea8068 Жыл бұрын
Great vid, thank you!
@brettwestwooddeveloper Жыл бұрын
You are welcome!
@aburaihan-py4vi Жыл бұрын
Excellent!!!!!!!!!
@protonys10 ай бұрын
Hello, how will realize form validation?
@brettwestwooddeveloper10 ай бұрын
Use zod or something similar
@cloudagnostic Жыл бұрын
On the form component, could i just import useState instead of useRef to reset the fields? I’m not that familiar with useRef. Great video by the way
@brettwestwooddeveloper Жыл бұрын
Thank you! And yes you can use useState hook as well to reset the form.
@dev-akeel Жыл бұрын
Yes, absolutely useState can be used. But it is better to use useRef for better performance, refer to re-rendering in react useState.
@Wortkotze1512 Жыл бұрын
is there a link to a github repo :) sometimes this helps to see the whole example at the end?
@darioalves77398 ай бұрын
When you add the expense, looks like the page is refreshing, right? that's not good.
@crim-son Жыл бұрын
My main issue with this is that, i can't know if the server action succeeds or fails, what if the user doesn't have a good network?...i have to use a form everytime I want to use server actions, what if i want it on a click of a button?, id rather just stick to creating APIs and making client side requests
@brettwestwooddeveloper Жыл бұрын
I agree with you, I still mainly use API endpoints and only really user server actions on contact forms at the moment. However, things could always change.
@crim-son Жыл бұрын
I hope Nextjs team sees the struggle with the use of server actions and come up with brighter ideas, its really beautiful not to have to create and API endpoint for every action, but it also comes with consequences@@brettwestwooddeveloper
@techlightdev11 ай бұрын
Thank you
@hulashmahto99 Жыл бұрын
Revalidate tag how to use
@brettwestwooddeveloper Жыл бұрын
I talk about how to use the Revalidate tag at 7:26 mark
@hulashmahto99 Жыл бұрын
@@brettwestwooddeveloper revalidate tag not revalidatepath
@PeriklesPeriklesoglu11 ай бұрын
thank you
@marroos5440 Жыл бұрын
Hi, i am self-taught and I've started learning Next.js 13 2-3 months ago, i have learned how to create simple full-stack app, where app communicates to DB via prisma ORM in/api folder's routes. I liked that way, allowed me to separate backend codes from frontend, but now i see Next.js 14 and Server Actions on every corner. What does that mean for me? Should i stop using /api folder way, and start using server actions, or can i still use /api folder way? Thinking of server actions as newer way, as a part of latest version of Next.js, server actions are probably recommended way. It is a big change for me, who did not learn Next.js completely, yet i need to change big part of how i managed db stuff in my app. Thanks to Your video i am starting to understand server actions, thank you. :}
@brettwestwooddeveloper Жыл бұрын
I would still stick with API folder routes. It is better overall in my opinion anyways.
@aguud Жыл бұрын
nice video
@Vickysingh02710 ай бұрын
That will show error "only plain objects can be passed to the client component"
@muradqumizakis8428 Жыл бұрын
why do you call it prism when your clearly writing prismA (love the video learned alot)
@brettwestwooddeveloper Жыл бұрын
hahaha speech impediment
@commashalfstrokes7575 Жыл бұрын
github link please
@brettwestwooddeveloper Жыл бұрын
sorry don't have for this. It's more of a tutorial
@commashalfstrokes7575 Жыл бұрын
@@brettwestwooddeveloper and it would be really helpful if you do tutorial on a large scale project (like may be a million of users ).. like how should we proceed about it. what will be the best practices when we use next 14. how will be the folders structure architecture.. like a boilerplate kinda thing.. I guess nany of us get understanding in small scale app. but get stuck in architecture wise while going for building large-scale application.
@VladyslavChapiuk-p4q2 ай бұрын
It is impossible to have rent for 800$. Other than that, nice video. Thank you!
@brettwestwooddeveloper2 ай бұрын
Its definitely possible
@axolotic698111 ай бұрын
Maybe it's easier, but you send more code and other things to the client = more code = more traffic + more insecure
@viniciusrangel544 Жыл бұрын
i still dont like this idea, just refetch everything, you can have some weird behaviors.. lets say that i have a "big" system where 2 users or more can add the data at the same time, the refetch will bring the new items which i didnt create. the optimistic way where you can just push to your state its better
@sebas156895 ай бұрын
Bro's knoweledge of react : 9.5 Bro's knoweledge of basic windows: 1 Lol unless you code in mac or linux I dont understand how is it that you look like my grandma trying to use the computer when moving stuff around the screen
@brettwestwooddeveloper5 ай бұрын
hahahah yea probably honestly.
@NitinSharma-fh5fl5 ай бұрын
bro you look ai generated
@therealdevopsintern Жыл бұрын
Too much over engineering just to use server actions. I don't think I will be using it. Please viewers don't swallow any new release that comes up, just take a little taste of it and throw it out.
@berniko4954 Жыл бұрын
True, I prefer standart front to back communications with API, mutating data
@dawid_dahl Жыл бұрын
One can really tell you don’t have a clue what you are talking about.
@brettwestwooddeveloper Жыл бұрын
I partially agree with you but yea I think overall I will be sticking with API folder routes.
@therealdevopsintern Жыл бұрын
@@dawid_dahl your statement tells you don't know what is happening in the developer community. Server actions is fucked when you are using the same API for mobile app development.
@dawid_dahl Жыл бұрын
@@therealdevopsintern Why don’t you provide some arguments instead of just swearing and acting like an idiot?