Skip to content

Docs: correct way to use server action to update form data #53435

@pguardiario

Description

@pguardiario

What is the improvement or update you wish to see?

I'm looking for the correct way to use server actions to update form data (server component form without reloading page)
I can't find anything that looks like this in the server action documentation

Is there any context that might help us understand?

For example:

async function search(data) {
    'use server'
    // ?? do something like redirect or router.push here ???
}

return <form action={search}>...

Does the docs page already exist? Please link to it.

https://nextjs.org/docs/pages/building-your-application/data-fetching/building-forms

Metadata

Metadata

Assignees

No one assigned

    Labels

    DocumentationRelated to Next.js' official documentation.locked

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy