Jacob Paris
← Back to all content

Use ActionData to get form post body in Remix

Remix allows you to handle form submissions with the action method

The response of the action method is available through the useActionData hook

js
import { useActionData, json } from "remix"
export const action = async ({ request }) => {
return json({
token: "1234567890",
})
}
export default function Page() {
const { token } = useActionData()
// do something with token
}
Professional headshot
Moulton
Moulton

Hey there! I'm a developer, designer, and digital nomad building cool things with Remix, and I'm also writing Moulton, the Remix Community Newsletter

About once per month, I send an email with:

  • New guides and tutorials
  • Upcoming talks, meetups, and events
  • Cool new libraries and packages
  • What's new in the latest versions of Remix

Stay up to date with everything in the Remix community by entering your email below.

Unsubscribe at any time.