Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DO NOT CLOSE Draft for useForm submission / ongoing ensemble programming #100

Closed
wants to merge 1 commit into from

Conversation

thadk
Copy link
Member

@thadk thadk commented Oct 19, 2023

Started by trial and error but may be helpful to reference the library's guide: https://conform.guide/tutorial

Co-authored-by: plocket <[email protected]>
Co-authored-by: Gavin Kimball <[email protected]>
Co-authored-by: Leopardfoot <[email protected]>
Co-authored-by: Jeff Korenstein <[email protected]>
@plocket plocket changed the title Draft for Form / ongoing ensemble programming Draft for useForm submission / ongoing ensemble programming Nov 15, 2023
@plocket plocket changed the title Draft for useForm submission / ongoing ensemble programming DO NOT CLOSE Draft for useForm submission / ongoing ensemble programming Nov 15, 2023
@thadk thadk added the heat-app-js Issues related to the HEAT app frontend label Nov 22, 2023
@thadk
Copy link
Member Author

thadk commented Feb 4, 2024

I think the two big things we tried with conform in this ensemble programming session were below:

const TrialFormSchema = z.object({
imageUrl: z.string().optional(),
username: z.string(),
name: z.string(),
agreeToTermsOfServiceAndPrivacyPolicy: z.boolean({
required_error: 'You must agree to the terms of service and privacy policy',
}),
remember: z.boolean().optional(),
redirectTo: z.string().optional(),
})
const [form, fields] = useForm({
id: 'onboarding-provider-form',
constraint: getFieldsetConstraint(TrialFormSchema),
lastSubmission: actionData?.submission ?? data.submission,
onValidate({ formData }) {
return parse(formData, { schema: TrialFormSchema })
},
shouldRevalidate: 'onBlur',
})

<Field
labelProps={{ htmlFor: "1234", children: 'Username' }}
inputProps={{
type: 'text',
autoComplete: 'username',
className: 'lowercase',
}}
errors={[]}
/>

@thadk
Copy link
Member Author

thadk commented Mar 24, 2024

Implemented in e.g. #150

@thadk thadk closed this Mar 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
heat-app-js Issues related to the HEAT app frontend
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

1 participant