Комментарии:
Please consider on updating the tutorials for Next14
ОтветитьWhy are you using unstable useFormStatus and useFormState hooks since they are unstable?
ОтветитьIf I get this right, this can only work without JavaScript, if you load the website with JavaScript and disable it after
ОтветитьHey is this possible to use thhe useFormState with api route handler or fetch call ? as I dont use right now server actions in my app.
ОтветитьIt seems useFormState is only supported in the canary version. Has anyone been able to use this?
ОтветитьIf PHP was a guy, what he would be feeling right now?
ОтветитьHey there Lee, thanks for this. I wanted to ask how can i persist the typed in value in input field? EX: i have a page.tsx in signup folder -> signup/page.tsx , this one has the form in it and is server component. When i hit the sign up button, it goes to signup/route.ts with method post in <form method="post"/> . The route.ts for signup handles all the database management plus return NextResponse.redirect() etc as required. This is also server side. Both are server side. I just want to know how can i persist the input typed value so when i click the signup button i need to persist that typed in value and not make it disappear?
Ответитьthank you
Ответитьchoice cut
ОтветитьWhoever drew up Lee's specs was very kind. Smart, endearingly charming, adorable as all hell
Ответитьis there a reason why SubmitButton is a separate component instead of just being a part of AddForm. can we not use both useFormStatus and useFormState hooks in the same component?
ОтветитьHello, very interesting but I wonder what about security? Do we have access to the request to now if users are authorized or not?
ОтветитьHi, awesome tutorial as always. Please can I get the name of the Code editor's theme? Thanks
Ответитьwelcome to PHP, oops, next.
ОтветитьSince `aria-disabled` is used here, we must programmatically prevent clicking while pending state.
how can i handle this?
instant subscription
Ответитьcan you make a video about caching in server and client components?
Ответитьapp router tribe baby lets go
ОтветитьI'm new to nextjs13 , in react I was using react query to handle remote data coming from api and show isloading on screen and also optimistic UI , and I want to know does next 13 need any library to handle those functions or I just need to create fetch request in any server component I want. my current next project is a blog
ОтветитьThanks for this tutorial, Lee. Excellent job clarifying in simple terms the elements of server actions.
ОтветитьThanks, great vid! Is it possible to use GET instead of POST with server actions?
Ответитьyou could be the most clear speaking person
ОтветитьHow would you recommend approaching submitting a form that relies on state being built up over time? For example: a form with multiple inputs including an input that builds an array of values through something like a multi-select input or an input collecting a list of emails?
Ответитьi would like to see binding extra arguments and formless use of server actions with starttransition as i feel there's a lot of interesting things that can be done with these methods.
ОтветитьThanks for the video Lee !
Ответитьis adding some data using hidden input are recommended ways by nextjs team? is it a best practices or i can try another way? why just not passing the hidden data in initial argument of form hooks , it looks like more simpler rather than adding additional html element
ОтветитьIn the latest react useFormState is not present
ОтветитьIs there an LLM that is trained on these latest features? I am trying to learn and ChatGPT is a huge help but it knows nothing of this.
ОтветитьCan you do an example where JavaScript is disabled, server side validation fails, and we need to show an error state to the user. This doesn't seem to work in the example provided.
ОтветитьIf this was a login form, how would you handle session storage?
ОтветитьAre server actions still technically experimental?
ОтветитьGreat tip, aria-disabled instead of disabled!
Ответитьcan you make tutorial for how to intigrate and work with postgres with next js without express
ОтветитьSuper great and educational videos you do! Keep it up!
Ответитьi don't get why you have use client on top
ОтветитьThis is good. What about validations message when typing. That’s the real use case
ОтветитьPlease no one is talking on the revalidate tag, how can u use it in this case??
ОтветитьThats very nice and useful. But I ask aren't we delegating too much responsibility to the "behind the curtains"?
Ответитьthanks lee, this is awesome. I'm just wondering how to clear the text input after a new todo has been created. So much cool stuff to try out!!!
ОтветитьI genuinely love Next. It has changed my life financially and has made working with the web intuitive.
Ответитьi'm getting an error while running the dev server: VercelPostgresError - 'missing_connection_string': You did not supply a 'connectionString' and no 'POSTGRES_URL' env var was found.
Ответитьnice video, what if we have a modal and we want to close it after the server action is done and returned value from server, ?
ОтветитьGreat job guys, I'd love if server get stable and I will heavly use it !!
ОтветитьWhen cloning the project locally and filling in my vercel database credentials I get "Error: db error: ERROR: relation "todos" does not exist
Caused by:
ERROR: relation "todos" does not exist"
And when im tryting to deploy this straight from the template to vercel It also won't build.
Type error: '"react-dom"' has no exported member named 'experimental_useFormState'. Did you mean 'experimental_useFormStatus'?
1 | 'use client'
2 |
> 3 | import { experimental_useFormState as useFormState } from 'react-dom'
| ^
4 | import { experimental_useFormStatus as useFormStatus } from 'react-dom'
5 | import { createTodo } from '@/app/actions'
6 |
error Command failed with exit code 1.
Something broken with the template?
I know documentation is being worked on, but could you describe in 1-2 lines what experimental_useFormState does exactly?
ОтветитьReal shame that useFormState only works in client components - IMO this prevents proper progressive enhancement with javascript disabled (i.e. we can't return errors from the action). Remix's useActionData allows this to happen.
ОтветитьThis is great! Can you do a follow up with some more advanced stuff? Like, how do I handle optimistic updates & failures/rollbacks, how do I ensure my TODOs mutation state is synced across all pages/components that might need it, how can I update TODOs state from within the app code (not as part of a form submission). In other words -- is it possible to use this new paradigm to replace most of what Redux does?
ОтветитьThanks, very helpful video. How would you go about clearing the input after submitting with server actions?
ОтветитьWhen JS is disabled we don't get action returns. in state
ОтветитьHey, could you maybe shed some light on Auth + XSRF on this? As it's submitting a form and if cookies are used for Auth, this would be vulnerable to XSRF attacks, right?
Ответить