Appending Custom Inputs to FormData using useActionState #74228
Unanswered
enzzzooo
asked this question in
App Router
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I am looking to use a custom date picker, instead of the ugly default html component.
I can use a callback function
<DatePicker onChange={handleDateChange} />
to add the selected date to the formData using .append(). Though it does not list this anywhere in the docs.
I am using useActionState so how does the function in
const [formState, formAction, isPending] = useActionState(createTrip, {})
recieve the new formData that includes the date?
In my server action I am looking to access the date just as if it was a normal input component like
const date = formData.get("date")
Beta Was this translation helpful? Give feedback.
All reactions