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.
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.
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.
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).
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.
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?
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.
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.
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.
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?
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?
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.
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!
Awesome, thank you!
Server actions might make the actual request simpler, but React Query seems a lot better for managing the state of your fetch requests.
your doing well man. im glad you joined the scene
Thank you sir for this short video with very important information that I needed to hear.
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
Good idea
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.
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.
Thanks for your clear explanation! ❤
Thanks for your video and explanation! It's helpful to me!
This is exactly what I was looking for. Thanks.
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).
turborepo? you create reusable components for each client (assuming they all use typescript/javascript)
Yeah that is what I am not a fan of server action. There are made to be used by your nextjs front ONLY.
another great class. thank you
Appreciate the way you explain things
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.
Thank you so much
very interesting! clear explanation 👏 Would this apply for a datagrid too?
Best explanation on TH-cam 🤩
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?
Yes, works outside forms too but you have to invoke the server action differently (not with ‘action’ attribute)
Subscribed to this channel so hard! 👌🏻
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.
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.
Can you rate limit server acrions like api ? 😊
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.
Thank you
what's the diffirent with php
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?
In previous video you told importing something inside "use client" component then whatever is imported also runs on client side ?
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?
am I the only one who thinks "progressive enhancment" is bs ?
Yes 😂
Yes
Yes
Yes
Useful in 0.0001% of cases and has a fancy name
Good explanation
Nice comparison
When are you releasing you Next Js course?
It’s super close. Make sure you’re subscribed to the email newsletter :)
is it work only for app folder ?
How do you reset the form without using useState for each input field?
Well if you need the whole form reset, html forms have a reset method for wiping out inputs.
what is the name of vs code theme?
Thanks, how do I do it with dashboard and get data? outside of forms
Best to use fetch in a server component to get data