File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed
Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -37,14 +37,15 @@ The following example demonstrates how to use the `useWaitlist()` hook to create
3737' use client'
3838
3939import { useWaitlist } from ' @clerk/react'
40- import { useState } from ' react'
4140
4241export default function WaitlistPage() {
4342 const { waitlist, errors, fetchStatus } = useWaitlist ()
44- const [emailAddress, setEmailAddress] = useState (' ' )
4543
46- const handleSubmit = async (e : React .FormEvent ) => {
44+ const handleSubmit = async (e : React .FormEvent < HTMLFormElement > ) => {
4745 e .preventDefault ()
46+ const formData = new FormData (e .currentTarget )
47+ const emailAddress = formData .get (' emailAddress' ) as string
48+
4849 await waitlist .join ({ emailAddress })
4950 }
5051
@@ -64,9 +65,8 @@ export default function WaitlistPage() {
6465 <label htmlFor = " email" >Email address</label >
6566 <input
6667 id = " email"
68+ name = " emailAddress"
6769 type = " email"
68- value = { emailAddress }
69- onChange = { (e ) => setEmailAddress (e .target .value )}
7070 required
7171 />
7272 { errors .fields .emailAddress && (
You can’t perform that action at this time.
0 commit comments