Skip to content

v0.7.4

Compare
Choose a tag to compare
@edmundhung edmundhung released this 17 Jul 19:53
· 310 commits to main since this release

Improvements

  • Added a new helper for fieldset element (#221)
import { conform } from '@conform-to/react';

<fieldset {...conform.fieldset(field, { ariaAttributes: true })>

// This is equivalent to:
<fieldset id={field.id} name={field.name} form={fieldset.form} aria-invalid={...} aria-describedby={...}> 
  • [Experimetnal] Introduced an option to strip empty value on parse (#224)
// Instead of checking if the value is an empty string:
const schema = z.object({
  text: z.string().min(1, 'Email is required');
});

const submission = parse(formData, { schema });

// To supports native zod required check directly:
const schema = z.object({
  email: z.string({ required_error: 'Email is required'),his 
});

const submission = parse(formData, { schema, stripEmptyValue: true });

New Contributors

Full Changelog: v0.7.3...v0.7.4