Using Forms in Next.js (Server Actions, Revalidating Data)

แชร์
ฝัง
  • เผยแพร่เมื่อ 3 ม.ค. 2025

ความคิดเห็น • 213

  • @austincodes
    @austincodes ปีที่แล้ว +55

    Genuinely excited about this 🙌 I'd love to see more complicated examples with Zod validation

    • @discoverlance
      @discoverlance ปีที่แล้ว

      With zod validation, I tried one and if you look at what he did, the parsed variable returns an object with the parsed data but when you put it in a try catch, you can catch the instance of ZodError and get it's property formErrors.fieldErrors which will return all the errors.

    • @jeghaire
      @jeghaire ปีที่แล้ว +2

      Especially examples of zod and useForm hooks

    • @stevebendersky2056
      @stevebendersky2056 ปีที่แล้ว

      exactly@@jeghaire

    • @rafaelrocha3991
      @rafaelrocha3991 8 หลายเดือนก่อน +2

      There’s a library that combines both: next-safe-action
      Quite useful if you don’t want to create your own action validation wrapper.

  • @marktaylor865
    @marktaylor865 6 หลายเดือนก่อน +5

    I learn by doing. Not by reading. This was exactly what i needed. I implemented this, saw it working, learnt how and why it worked and added it to my project. Perfecto. Thanks bro.

  • @robgioeli
    @robgioeli ปีที่แล้ว +9

    I genuinely love Next. It has changed my life financially and has made working with the web intuitive.

    • @franciscooteiza
      @franciscooteiza ปีที่แล้ว +10

      LIAR!!

    • @GeniusHawlah
      @GeniusHawlah 8 หลายเดือนก่อน +1

      @@franciscooteiza At least let him lie in peace.😂😂😂😂

  • @EvHaus
    @EvHaus ปีที่แล้ว +52

    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?

  • @kyle-andrewgovinder9902
    @kyle-andrewgovinder9902 ปีที่แล้ว +2

    Whoever drew up Lee's specs was very kind. Smart, endearingly charming, adorable as all hell

  • @KySuga.
    @KySuga. 9 หลายเดือนก่อน

    Love that you touched upon accessibility!

  • @maksymdudyk1718
    @maksymdudyk1718 7 หลายเดือนก่อน +7

    new, important and complicated concept such as `server action` the author explains on even more complicated usecases.

  • @Krzysiekoy
    @Krzysiekoy ปีที่แล้ว +5

    3:21 - wait a minute. Maybe I'm not understanding something, but doesn't schema.parse throw an error if the data is incorrect? And if yes, shouldn't it be inside the try block?

  • @MikeBritton
    @MikeBritton ปีที่แล้ว

    Thanks for this tutorial, Lee. Excellent job clarifying in simple terms the elements of server actions.

  • @pawelblaszczyk__
    @pawelblaszczyk__ ปีที่แล้ว +9

    Really nice video, your explanations are always amazingly informative, thanks a lot 🔥Also, can’t wait for the stable release of the “cache” function, good to know that it’s coming soon

    • @OptimBro
      @OptimBro ปีที่แล้ว

      The video shows the uploaded time 5 mins ago when I am writing this comment, and your comment shows posted 5 hours ago 😬😬
      i.imgur.com/2o1sCXW.mp4

    • @pawelblaszczyk__
      @pawelblaszczyk__ ปีที่แล้ว

      @@OptimBro it was unlisted and linked in Next.js docs update PR before official publication 😄

    • @OptimBro
      @OptimBro ปีที่แล้ว

      ohh that was the puzzle@@pawelblaszczyk__ , thanks 🙏🙏😂😂

  • @improvingwithfun
    @improvingwithfun 7 หลายเดือนก่อน

    Hi Lee and engineers 👋
    Thank you for the smooth video. Watching this I came to a few questions:
    1. What is the reason to move from the previous approach? How much performance are we winning here? It would be nice to see some good and old before/after comparisons.
    2. Many people are asking for more advanced cases, but are those even possible? I don't see modern forms without the usual rerendering that we used until now.
    Thank you and I hope for more such videos in the future!

  • @JamesNMK
    @JamesNMK 5 หลายเดือนก่อน

    this thing definitely gonna hurt my head for a few days. thanks for the video.

  • @СергійК-ш4у
    @СергійК-ш4у 9 หลายเดือนก่อน

    Thanks a lot for your explanations and demo it was really useful for me. The only question I didnt find answer on is how to handle multiple actions within single form

  • @RobertoCestari
    @RobertoCestari 7 หลายเดือนก่อน

    Hello Lee
    On minute 7:24, when you delete a todo and use revalidatePath, the code shown does not work. You would never be able to get the returned message (on lines 50 to 52). Ireproduced your example. This is probably because the todo is removed from component tree, and therefore the state is reset.

  • @guylepage33
    @guylepage33 9 หลายเดือนก่อน

    Great walk through as usual! Thank you. 🙏

  • @yowremco
    @yowremco ปีที่แล้ว +2

    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?

  • @filipkovac767
    @filipkovac767 ปีที่แล้ว +3

    Please make long format video diving into topics like:
    client side validation, dependant fields, client side data formatting, array fields...

    • @dealloc
      @dealloc ปีที่แล้ว +1

      1. Use HTML input validation attributes.
      2. Validate on server, returning the names of dependent inputs in the result of form action, or implement a client-side solution if you need instant feedback.
      3. ??? This is not in scope, data formatting is highly subjective. But if you need a specific format on the server, deserialize the form data there.
      4. Use name="some_field[]" as the name of one or more inputs, i.e. checkboxes.

  • @morg33327
    @morg33327 ปีที่แล้ว +3

    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?

    • @rafaelrocha3991
      @rafaelrocha3991 6 หลายเดือนก่อน

      well if it relies a lot on user interaction to progressively enhance the form (dependent fields and so on) you can’t really just use the server for that unless you submit the form at several points and return different forms dependent on the server side state (storing it in memory or KV store)

  • @electroheadfx
    @electroheadfx ปีที่แล้ว +1

    I just installed I have error on '"react-dom"' has no exported member named 'experimental_useFormState'. Need I an special npm install for use experimental react feature ?

    • @leerob
      @leerob  ปีที่แล้ว +2

      It seems there's a TypeScript error there at the moment, you can ts-ignore that, we'll fix it here in a patch release very shortly (apologies!).

    • @BaileySimrell
      @BaileySimrell ปีที่แล้ว

      @@leerob still doesn't work after adding ts-ignore error TypeError: (0 , react_dom__WEBPACK_IMPORTED_MODULE_4__.experimental_useFormState) is not a function or its return value is not iterable

    • @jauki2742
      @jauki2742 ปีที่แล้ว

      @@BaileySimrell did you find a solution for this problem because i encountered the same problem exept i am not using the experimental_useFormState, just the useFormState, been to multiple GitHub Issues, but didn't figure it out

  • @AlfonsusAC
    @AlfonsusAC ปีที่แล้ว

    Thank you for the video. Very imformative. Shows how easy it is to create form in Next.js!

  • @kamill34
    @kamill34 ปีที่แล้ว +2

    does the server actions is still expermiental flag?

    • @leerob
      @leerob  ปีที่แล้ว

      For now, yes: nextjs.org/docs/app/building-your-application/data-fetching/forms-and-mutations

  • @pankaj-kumar-yadav-67
    @pankaj-kumar-yadav-67 2 วันที่ผ่านมา

    Which VS CODE theme are you using?

  • @abdullahisiaq9348
    @abdullahisiaq9348 15 วันที่ผ่านมา +1

    This doesn't work. I tried to use it but it kept on throwing me an error saying that "Cannot access get on the server. You cannot dot into a temporary client reference from a server component. You can only pass the value through the client"

  • @solaaar3
    @solaaar3 ปีที่แล้ว

    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.

  • @aralroca
    @aralroca 10 หลายเดือนก่อน

    I tried the example but I get "Error: An error occurred in the Server Components render but no message was provided" 😅

  • @jsinnerx
    @jsinnerx 10 หลายเดือนก่อน

    What about unit tests for those features? It looks like that "action" usage will cause some issues on unit tests.

  • @alexmg404
    @alexmg404 ปีที่แล้ว +2

    Thanks, very helpful video. How would you go about clearing the input after submitting with server actions?

    • @agus-wesly
      @agus-wesly ปีที่แล้ว +1

      make the input client component, use the useRef hook with useEffect, inside of the effect check for the form status and clear it

  • @gmzi
    @gmzi ปีที่แล้ว +2

    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!!!

  • @josaelprz
    @josaelprz 8 หลายเดือนก่อน

    Does revalidatePath adds some payload to the response in conjunction with the data you return on your server action or revalidatePath streams the new state to acknowledge the client to revalidate cache and update UI and then the server action return statement is hit, streams another response and the client updates again?

  • @ethan2130
    @ethan2130 3 หลายเดือนก่อน

    how about the front-end form validation before submitting to the server action? Or just rely on the HTML attribute? and the server action catch block's return error message?

  • @sillvvasensei
    @sillvvasensei ปีที่แล้ว +1

    Can you revalidate multiple tags yet? When I tried previously, it had issues when trying to call revalidateTags multiple times with each tag

  • @ZubairMughal-y7c
    @ZubairMughal-y7c 11 หลายเดือนก่อน

    any videos on server side sorting? would it follow the same principle of passing a slug or id?

  • @yashjha0007
    @yashjha0007 ปีที่แล้ว +1

    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?

    • @vinayparmar488
      @vinayparmar488 3 วันที่ผ่านมา

      Because button is interective, it has to be a client side component, thus it is separate component

  • @panoscool_
    @panoscool_ 9 หลายเดือนก่อน

    @leerob why server actions cannot be used for data fetching from a db?

  • @GeniusHawlah
    @GeniusHawlah 8 หลายเดือนก่อน

    So if I need the todo data in some other far-away components, I have to prop-drill?

  • @ktrifon
    @ktrifon 7 หลายเดือนก่อน

    What if this form was a search form and below you wanted to see filtered ToDos?
    In this case, the server action should return data based on the search criteria but how do you return this data?
    The todos area should not fill by a full db search now, it should fill with the results of the sever action. You have to use the search term from the form.
    I am missing something here and I cannot do it (for the moment).
    Also, I am not sure any more which component should be a server component and which one should be a client component.
    Is my approach wrong?
    Are server actions ONLY for mutations? Any suggestions? (All the videos show server actions mutating data. I want just a search)
    Thanks...

  • @AllysonTS
    @AllysonTS 11 หลายเดือนก่อน

    Lee, is there any way to simulate the following scenario: I have a component called user.tsx and another called filters.tsx, using useSearchParams I can pass a "state" to users.tsx and use this data from filter.tsx to change the data displayed on my screen. This with react query is very simple, because if there is any change in the queryKey (the filters in this case) it automatically invalidates the current query and redoes the fetch. My question is: Is there a way to obtain a similar result using only server actions and fetch making requests to a api?

  • @vuletav
    @vuletav 6 หลายเดือนก่อน

    Vercel does not mention the use of server actions for data fetching in the documentation? Apparently they don't cache?

  • @neil4411
    @neil4411 11 หลายเดือนก่อน

    Love the tutorial! Would there be a way to unit test "action" attribute?

  • @Abdullah-oj2ih
    @Abdullah-oj2ih ปีที่แล้ว

    what camera are you using?

  • @rockNbrain
    @rockNbrain ปีที่แล้ว

    Great job guys, I'd love if server get stable and I will heavly use it !!

  • @shadowfaxenator
    @shadowfaxenator ปีที่แล้ว +1

    When JS is disabled we don't get action returns. in state

  • @ishakimanuel3513
    @ishakimanuel3513 ปีที่แล้ว

    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

  • @mohamed-zhioua
    @mohamed-zhioua ปีที่แล้ว

    always appreciating your valuable content

  • @Sorkstryparen
    @Sorkstryparen ปีที่แล้ว

    Super great and educational videos you do! Keep it up!

  • @jordancutler7552
    @jordancutler7552 ปีที่แล้ว

    Hey Lee, for the `aria-disabled`, do we not need to worry about accidental double submit behavior?

    • @leerob
      @leerob  ปีที่แล้ว +1

      You'd want to add that code in `onClick`: a11y-101.com/development/aria-disabled

  • @wolffair1119
    @wolffair1119 11 หลายเดือนก่อน

    Is there a video how to perform unit testing on this form? I tried setting it up but getting errors about 'useFormState' Any help would be appreciated.

  • @vignesh_m_1995
    @vignesh_m_1995 7 หลายเดือนก่อน

    Suppose we have a table in a Next JS page and the table has a filter (client) component with interactivity. When we hit Apply, how do we pass the filter values from the client child to the server parent component. (The parent fetches the data and renders the table). I can see many suggestions to pass the data as params or queryParams using revalidate or nav methods of next. That works fine for a simple values like ID or search params. For example, if it is not just an ID but an object (advanced filter similar to the one in Amazon), should we just pass the entire object via the search params and make the URL bloated with so many values or are there any alternate way to communicate from client child (filter) to server parent component (where data is fetched) ??

  • @fayrouzadham4808
    @fayrouzadham4808 ปีที่แล้ว +1

    experimental_useFormState doesn't show up in react-dom

  • @MatthewMammola
    @MatthewMammola 5 หลายเดือนก่อน

    When starting off this example, is it necessary to do some configuration before it can be used? It is immediately giving me a error upon first npm run dev - Error: connect ECONNREFUSED ::1:5432
    Do i need to create a server it can communicate with before this example can be used?

    • @tiagodev5838
      @tiagodev5838 3 หลายเดือนก่อน

      I'd say that it is assumed you have a sql server running and configured a connection to it.

  • @didardev
    @didardev ปีที่แล้ว

    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, ?

  • @FatihAltnok
    @FatihAltnok ปีที่แล้ว

    Great tip, aria-disabled instead of disabled!

  • @flavienpensato9907
    @flavienpensato9907 ปีที่แล้ว

    Hello, very interesting but I wonder what about security? Do we have access to the request to now if users are authorized or not?

  • @andrethomas3262
    @andrethomas3262 23 วันที่ผ่านมา

    Is there a way to prevent the form from resetting if there is a validation error?

  • @electroheadfx
    @electroheadfx ปีที่แล้ว

    the exemple use Vercel postgres grant, is it possible to have a public one for test?

    • @leerob
      @leerob  ปีที่แล้ว +1

      You could use any postgres database, it's just one example!

  • @MICHAELZ50
    @MICHAELZ50 ปีที่แล้ว

    May I know what is the purpose of writing the 2 hidden input tags in DeleteForm Component?

    • @leerob
      @leerob  ปีที่แล้ว +1

      To forward that data in `FormData`, to be used in the Server Action.
      www.w3schools.com/tags/att_input_type_hidden.asp#:~:text=Definition%20and%20Usage,when%20the%20form%20is%20submitted.

    • @MICHAELZ50
      @MICHAELZ50 ปีที่แล้ว

      @@leerob oh I see. Is it because now the DeleteForm component has its own tag so it needs some "hidden" input values acting as ID in the FormData for server action?

  • @blazi_0
    @blazi_0 ปีที่แล้ว

    Please no one is talking on the revalidate tag, how can u use it in this case??

  • @jeanpierrejeri6425
    @jeanpierrejeri6425 ปีที่แล้ว

    When you have javascript enabled, and add a todo, the new todo title doesnt get clean up, how can i do that?

  • @sugagusto6175
    @sugagusto6175 6 หลายเดือนก่อน

    state returned from action always contain: 0:[$@1, “development, null]. how to remove that?

  • @Mavesound
    @Mavesound ปีที่แล้ว

    What's the big difference between React Hook Form?

    • @leerob
      @leerob  ปีที่แล้ว

      React Hook Form uses the same patterns as the Pages Router towards the beginning on the video (event handlers)

  • @NikitaPolovinkin
    @NikitaPolovinkin 2 หลายเดือนก่อน

    Why when you press "Add" the Form does not reset?

  • @81NARY
    @81NARY ปีที่แล้ว +1

    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?

  • @stevebendersky2056
    @stevebendersky2056 ปีที่แล้ว

    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.

  • @mystupidbrain5299
    @mystupidbrain5299 ปีที่แล้ว

    If this was a login form, how would you handle session storage?

  • @parham1894
    @parham1894 ปีที่แล้ว

    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

  • @dhkim6672
    @dhkim6672 ปีที่แล้ว

    Since `aria-disabled` is used here, we must programmatically prevent clicking while pending state.
    how can i handle this?

    • @leerob
      @leerob  ปีที่แล้ว

      I have an example here, you can use onClick on the button: github.com/vercel/commerce/pull/1209

    • @dhkim6672
      @dhkim6672 ปีที่แล้ว

      ​@@leerob Thank you for the excellent reference. It has helped me understand server actions better!

  • @scottnoring2960
    @scottnoring2960 2 หลายเดือนก่อน

    I'm getting the error: TypeError: (0 , react__WEBPACK_IMPORTED_MODULE_1__.useActionState) is not a function or its return value is not iterable. I am usig React 19 canary version and this original code.

  • @daffastack
    @daffastack ปีที่แล้ว

    untill now i cant use "useFormStatus" from react for adding loading state when submitting form server actions
    error message :
    'experimental_useFormStatus' is not exported from 'react-dom' (imported as 'useFormStatus')
    any sugestion or help ?
    currently i use :
    "next": "^14.0.4",
    "react-dom": "^18.2.0",

    • @letsplayanything1829
      @letsplayanything1829 10 หลายเดือนก่อน

      Same for this specc:
      "next": "^14.1.1-canary.46",
      "react": "^18.2.0",
      did you found a solution to this ?

    • @daffastack
      @daffastack 10 หลายเดือนก่อน

      @@letsplayanything1829 I didn't have any solutions yet 😭

    • @daffastack
      @daffastack 10 หลายเดือนก่อน

      Now I set loading state before and after actions at the form
      Like :
      {
      setLoading={true}
      AddData(formdata)
      setLoading={false}
      }
      }>
      // form input component
      This is also works but not best solutions

  • @visheshmangla8220
    @visheshmangla8220 3 หลายเดือนก่อน

    How to add middleware headers to this? Like in case of login form, in middleware.tsx I m fetching the csrftoken from my django rest api. I can check the cookies in action but that's double work.

  • @ahmedivy
    @ahmedivy ปีที่แล้ว

    Why server actions can't be used directly as a value to onClick attr for a button and just passed the data as an argument to function and nextjs will serialize automatically to send the request on server?

    • @dealloc
      @dealloc ปีที่แล้ว +1

      Server actions are serialized to URL endpoints on the output, that is then handled by Next and directed to the correct server action handler. onClick are for client-side only events, and you cannot serialize function from server -> client. This the same reason you cannot pass a function to event handlers within server components.

    • @ahmedivy
      @ahmedivy ปีที่แล้ว

      @@dealloc then we should use server actions only for forms? I mean if i have a button that when triggers has to change some data on server then api endpoints are more clean? Bcs if i have to make it a server action i have to enter all the things that i want to send as a payload (for example in apis), as a hidden form fields, isn't that gets more complicated?

    • @dealloc
      @dealloc ปีที่แล้ว

      @@ahmedivy It depends on what you're doing-for simple server-side mutations, this is the approach to use as it can be progressively enhanced (i.e. work without JavaScript), and with React's upcoming hooks to handle form state, loading, optimistic updates, etc.
      It's not a silver bullet solution; e.g. you cannot use form submissions to recieve callbacks from a request (i.e. send data, waiting for a response from the server), in those cases you should use regular fetch, or a library like React Query/swr to handle client-side fetching. But this limits you to only support users with JavaScript, which may in some cases be what you want, and in other cases not.
      These are _Server_ actions. It's in the name ;)

  • @splodys
    @splodys ปีที่แล้ว

    Hey Lee, great content as always!
    Will you do a new video regarding next auth and providers like credentials, google and github?
    Credentials is mostly covered in the nextjs learn course, but google auth is not.
    I've been wondering if we should use api routes to handle this or is there any way using form actions as well.
    Thanks and keep up the great work!

  • @codeyalaya
    @codeyalaya 9 หลายเดือนก่อน

    your code does not work when deployed to vercel and javascript disabled

  • @rijkvanwel
    @rijkvanwel ปีที่แล้ว

    I know documentation is being worked on, but could you describe in 1-2 lines what experimental_useFormState does exactly?

  • @codeyalaya
    @codeyalaya 9 หลายเดือนก่อน

    how to show #contact section of a long page, after submitting form using server actions with js disabled. #contact section is at last of the page.

  • @whoman7930
    @whoman7930 ปีที่แล้ว +1

    Can you make a video on authentication patterns with the new app router?

    • @leerob
      @leerob  ปีที่แล้ว +2

      Yeah, I can make one on this eventually! Good suggestion.

    • @OptimBro
      @OptimBro ปีที่แล้ว

      with a middleware, database examples maybe@@leerob

    • @lzl0_699
      @lzl0_699 ปีที่แล้ว

      That would be a great video. 👍

    • @whoman7930
      @whoman7930 ปีที่แล้ว

      @@leerob Specially I wanted to know if I should use middleware to protect some routes, or should I use the redirect function in server components?

    • @wriddhihazra
      @wriddhihazra ปีที่แล้ว

      @@leerob that would be amazing if you could show some cool new do some standard well known stuff like CRUD(this video) and authentication and then maybe even streaming data and websockets. Love you guys at the NEXT.js team, this magical framework really makes fullstack development a joy and as simple as it should've always been.

  • @MichaelPresecan
    @MichaelPresecan ปีที่แล้ว

    In the latest react useFormState is not present

  • @patrickjreid
    @patrickjreid ปีที่แล้ว +2

    This was a great explaination... the docs were pretty hard to follow and understand. None of the examples connect together so its hard to get a full picture of what is going on.

  • @umair170
    @umair170 8 หลายเดือนก่อน

    Does amyone know if Next exposes those hooks to keep the API consistent? The ones that are unstable in react canary?

  • @JuanPabloGallegoJaramillo
    @JuanPabloGallegoJaramillo 9 หลายเดือนก่อน

    por que se reinica el componente cuando envio la data , nunca llega el console.log?
    export async function createMemberTeam(formData: FormData) {
    'use server';
    console.log('createMemberTeam', formData);
    }

  • @nerophase
    @nerophase 6 หลายเดือนก่อน

    hey does anyone knows what vscode theme is that?

  • @howardcohen1653
    @howardcohen1653 8 หลายเดือนก่อน

    also how would someone cleanup the inputs

  • @portalplays3760
    @portalplays3760 ปีที่แล้ว

    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.

    • @portalplays3760
      @portalplays3760 ปีที่แล้ว

      Looks like this was fixed in 13.5.4! Thanks! 🙂

  • @abhaykumar9806
    @abhaykumar9806 9 หลายเดือนก่อน

    Had a very bad experience trying to work with method="GET" in next js forms. Nothing works. Always does a full page refresh. Didn't have these many probems in remix

    • @AbuBakr1
      @AbuBakr1 6 หลายเดือนก่อน

      Are you promoting remix? No thanks

  • @jasonsouthin6981
    @jasonsouthin6981 ปีที่แล้ว

    Thanks for the video Lee !

  • @jeffz7035
    @jeffz7035 ปีที่แล้ว

    Are server actions still technically experimental?

  • @RadTwin
    @RadTwin ปีที่แล้ว

    Can you share what that voice over app is you are using?

    • @leerob
      @leerob  ปีที่แล้ว

      It's native Voiceover on Mac! support.apple.com/guide/voiceover/turn-voiceover-on-or-off-vo2682/mac

  • @amesqFF
    @amesqFF 10 หลายเดือนก่อน

    hi, right? how make to clear input later add a todo?

  • @mufassirshah9376
    @mufassirshah9376 ปีที่แล้ว +1

    Great stuff 🔥🔥

  • @maximilianorios
    @maximilianorios 3 หลายเดือนก่อน

    There is something driving me crazy. I've seen this example in million places, and const formData = new FormData(event.currentTarget) does not compile in Vercel. It explicitily says that event.currentTarget is not assignable to HtmlFormElement. It works locally, runs correctly, but Vercel refuses to build it.

  • @giovannitonussi3746
    @giovannitonussi3746 ปีที่แล้ว

    Thats very nice and useful. But I ask aren't we delegating too much responsibility to the "behind the curtains"?

  • @Abhishek-fw7oo
    @Abhishek-fw7oo ปีที่แล้ว

    Now we want Lee to create a next js course for nextjs 2077 ❤

  • @NoahArk-x5g
    @NoahArk-x5g 4 หลายเดือนก่อน

    May I ask where is the db connection

    • @leerob
      @leerob  4 หลายเดือนก่อน

      I'm using Neon Postgres in this video, which can connect over HTTP or though a direct connection

  • @Lmsk-t5d
    @Lmsk-t5d 7 หลายเดือนก่อน

    hidden input for ID is not secured solution to my mind, has anyone better approach for it?

  • @MadanGhimire-b7z
    @MadanGhimire-b7z 10 หลายเดือนก่อน

    can you make a video on how to connect with postgres database for this project

  • @discoverlance
    @discoverlance ปีที่แล้ว

    I will install the latest next update in my project to test but earlier when I tested, forms were not working without JavaScript and redirect in a server action was failing 😢

    • @leerob
      @leerob  ปีที่แล้ว

      Make sure you're on the latest version, 13.5.2 at this time!

  • @appstuff6565
    @appstuff6565 ปีที่แล้ว

    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 . 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?

  • @faizanahmed9304
    @faizanahmed9304 ปีที่แล้ว

    Great explanation!

  • @sinamalakzadeh4843
    @sinamalakzadeh4843 3 หลายเดือนก่อน

    how to reset the input ??

  • @samarnagar9699
    @samarnagar9699 ปีที่แล้ว

    can you make tutorial for how to intigrate and work with postgres with next js without express

  • @Dev-Siri
    @Dev-Siri ปีที่แล้ว

    THEY FINALLY FIXED THE "GET STATE BACK FROM SERVER ACTIONS' ISSUE.