Check out our talk at Remix Conf!

Hidden field

In this example, we add a hidden field to our form.

const schema = z.object({
  csrfToken: z.string().nonempty(),
  firstName: z.string().nonempty(),
  email: z.string().nonempty().email(),
  howYouFoundOutAboutUs: z.enum(['fromAFriend', 'google']),
})

export default () => (
    <Form
      schema={schema}
      hiddenFields={['csrfToken']}
      values={{ csrfToken: 'abc123' }}
    />
)