The 3 REAL benefits of Next.js Server Actions

  Рет қаралды 32,410

ByteGrad

ByteGrad

Күн бұрын

Пікірлер: 56
@ByteGrad
@ByteGrad 8 ай бұрын
My Professional React & Next.js course is OUT NOW now! Find it here: bytegrad.com/courses/professional-react-nextjs -- this is the #1 resource to master the latest React & Next.js, my absolute best work.
@dopetag
@dopetag Жыл бұрын
This is the second video I have watched on this channel and I am already in love. The explanations are really clear and on point. Top level content!
@ByteGrad
@ByteGrad Жыл бұрын
Awesome, thank you!
@TheGrandChieftain
@TheGrandChieftain Жыл бұрын
Server actions might make the actual request simpler, but React Query seems a lot better for managing the state of your fetch requests.
@MaxOut931
@MaxOut931 3 ай бұрын
I think server actions are way overhyped in general - benefits are so minimal
@psyferinc.3573
@psyferinc.3573 Жыл бұрын
your doing well man. im glad you joined the scene
@phsopher
@phsopher Жыл бұрын
Helpful explanation thanks! Does this only work for forms? Suppose I just want to have a single button that does something, e.g., liking a comment on a social media site. Should I go through the whole process of wrapping it in a form, then making the button a separate child component etc. Seems easier to just make an api endpoint and call it on onClick. Or is there a more Nextonic (a word I just made up) way?
@ByteGrad
@ByteGrad Жыл бұрын
Yes, works outside forms too but you have to invoke the server action differently (not with ‘action’ attribute)
@saidibra9231
@saidibra9231 Жыл бұрын
can you please make a video between Next.js and Express.js and which one to choose in the back-end and the benefits and cons of each one
@ByteGrad
@ByteGrad Жыл бұрын
Good idea
@berndeveloper
@berndeveloper Жыл бұрын
Nextjs has a decent backend, but between Express and Nextjs for backend, I prefer "Nestjs". This last one is a JS backend framework that uses express but is opinionated, I recommend it with close eyes.
@gubocci
@gubocci Жыл бұрын
Having used nestjs for one medium large project - would not recommend. Way overkill for most projects and makes some simple things way too labour intensive.
@jorden123
@jorden123 Жыл бұрын
Thanks for your video and explanation! From a DevOps perspective... you are creating a monolith application, which you can not scale the front and the back separately, I guess this is the biggest downside. The other big downside is that you can not use multiple clients (front-ends) and using the same server (back-end).
@rjlacanlaled9419
@rjlacanlaled9419 Жыл бұрын
turborepo? you create reusable components for each client (assuming they all use typescript/javascript)
@Thikondrius
@Thikondrius Жыл бұрын
Yeah that is what I am not a fan of server action. There are made to be used by your nextjs front ONLY.
@HaowardWang
@HaowardWang Жыл бұрын
Thanks for your clear explanation! ❤
@matthiasmatanda4295
@matthiasmatanda4295 11 ай бұрын
Thank you sir for this short video with very important information that I needed to hear.
@martg0
@martg0 11 ай бұрын
very interesting! clear explanation 👏 Would this apply for a datagrid too?
@koolam5158
@koolam5158 3 ай бұрын
other than less boilerplate codes, more hooks available, is there some performance-wise benefits server actions have over api routes? still not really convinced yet but using POST all the time
@hibachouchene
@hibachouchene 9 ай бұрын
Best explanation on KZbin 🤩
@JasonWongFing
@JasonWongFing Жыл бұрын
Thanks for your video and explanation! It's helpful to me!
@cengizturk
@cengizturk Жыл бұрын
This is exactly what I was looking for. Thanks.
@ianc6418
@ianc6418 Жыл бұрын
another great class. thank you
@satyak1337
@satyak1337 5 ай бұрын
Can you rate limit server acrions like api ? 😊
@baliramgiri2877
@baliramgiri2877 Жыл бұрын
what if we have server in node and from there, we are storing cookies to browser and using in server components, so I am not possible get access of cookies to node server. is there any way?
@dawid_dahl
@dawid_dahl Жыл бұрын
Subscribed to this channel so hard! 👌🏻
@spas.z.spasov
@spas.z.spasov Жыл бұрын
Hello, thank you for the tutorials. What I'm searching for for complex form validation - i.e. a tutorial that puts together the 1) server actions + 2) react-hook-form + 3) zod.
@NeilGebhard
@NeilGebhard Жыл бұрын
Appreciate the way you explain things
@AnkitSharma-mu3oj
@AnkitSharma-mu3oj Жыл бұрын
In previous video you told importing something inside "use client" component then whatever is imported also runs on client side ?
@alvaro1728
@alvaro1728 Жыл бұрын
So on the surface it may seem simpler but in practice it still makes the same number of network trips and now you have to deal with NextJS and having client vs server components. BTW, you can easily abstract away the fetch calls inside utility classes (eg, api.todos.add(value)). It's a nice way to separate the concerns.
@appstuff6565
@appstuff6565 Жыл бұрын
can we use server actions for sign in , currently using action='/auth/sign-in' with method = 'post' where my sign-in route.ts in in app/auth/sign-in/route.ts?
@alexnelson2119
@alexnelson2119 Жыл бұрын
I've really been enjoying server actions. Nice not to have to make an api route. One thing I found out recently that's a bit annoying with respect to form data is there are no actual boolean type values you can get from HTML forms. Checkboxes only have 'on' when checked and no value at all if unchecked. Also, input forms always have string values when you get their value from formData, never a number, even if the input is type=number. Of course you can always do a combo of state and server actions.
@brancode404
@brancode404 Жыл бұрын
When are you releasing you Next Js course?
@ByteGrad
@ByteGrad Жыл бұрын
It’s super close. Make sure you’re subscribed to the email newsletter :)
@learner8084
@learner8084 9 ай бұрын
I'm confused. Do I use React Hook Forms or use Server Actions ? Does React Hook Forms also use server action ? If I use React Hook Forms, I give up the benefit of server actions ? Any advice any one ? Thanks very much in advanced.
@stevebendersky2056
@stevebendersky2056 Жыл бұрын
How do you reset the form without using useState for each input field?
@MrBrandenS
@MrBrandenS Жыл бұрын
Well if you need the whole form reset, html forms have a reset method for wiping out inputs.
@aymenbachiri-yh2hd
@aymenbachiri-yh2hd 6 ай бұрын
Thank you so much
@boyywnkobe
@boyywnkobe Жыл бұрын
is it work only for app folder ?
@mekelilyasa9561
@mekelilyasa9561 10 ай бұрын
what's the diffirent with php
@yigitardaunsal7269
@yigitardaunsal7269 Жыл бұрын
what is the name of vs code theme?
@ahmednoureldin6659
@ahmednoureldin6659 3 ай бұрын
i see a lot of server actions videos. and i understand the code but. i see no differences between server actions and api routes at all both fetch data both are server side both can be created in files to be reusable i can fetch data inline in any server component
@stevebendersky2056
@stevebendersky2056 Жыл бұрын
Thanks, how do I do it with dashboard and get data? outside of forms
@ByteGrad
@ByteGrad Жыл бұрын
Best to use fetch in a server component to get data
@mahdimotallebi7207
@mahdimotallebi7207 Жыл бұрын
Thank you
@devarshihazarika4871
@devarshihazarika4871 Жыл бұрын
am I the only one who thinks "progressive enhancment" is bs ?
@codedusting
@codedusting Жыл бұрын
Yes 😂
@ray-lee
@ray-lee Жыл бұрын
Yes
@gubocci
@gubocci Жыл бұрын
Yes
@Sube_Gordas
@Sube_Gordas Жыл бұрын
Yes
@loveboat
@loveboat 11 ай бұрын
Useful in 0.0001% of cases and has a fancy name
@coders_rant
@coders_rant Жыл бұрын
Good explanation
@SR-zi1pw
@SR-zi1pw Жыл бұрын
Nice comparison
Error Handling in Server Actions Next.js (Incl. Toasts!)
10:30
BAYGUYSTAN | 1 СЕРИЯ | bayGUYS
36:55
bayGUYS
Рет қаралды 1,9 МЛН
Chain Game Strong ⛓️
00:21
Anwar Jibawi
Рет қаралды 41 МЛН
It’s all not real
00:15
V.A. show / Магика
Рет қаралды 20 МЛН
New Features of Entity Framework Tools | Coding Shorts 113
12:15
Shawn Wildermuth
Рет қаралды 954
The Problem with React Server Actions
9:45
Josh tried coding
Рет қаралды 25 М.
React 19 STABLE - I Can't Believe They Changed This
11:18
ByteGrad
Рет қаралды 38 М.
When to use server actions in Next JS 14
5:28
WebDevEducation
Рет қаралды 11 М.
My Weird Journey To Next.js
24:28
Theo - t3․gg
Рет қаралды 50 М.
Forms with React 19 and Next.js
9:13
leerob
Рет қаралды 43 М.
Next 14 + React Query COMBO with Server Actions and RSC
9:49
developedbyed
Рет қаралды 122 М.
Next.js Server Actions...  5 awesome things you can do
7:51
Beyond Fireship
Рет қаралды 289 М.
BAYGUYSTAN | 1 СЕРИЯ | bayGUYS
36:55
bayGUYS
Рет қаралды 1,9 МЛН