Skip to content

Commit

Permalink
feature: (type) support array as field value (#57)
Browse files Browse the repository at this point in the history
  • Loading branch information
bhongy authored Sep 14, 2023
1 parent 470a405 commit 6c31cd1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
6 changes: 6 additions & 0 deletions .changeset/gorgeous-dogs-sniff.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@formspree/core': patch
'@formspree/react': patch
---

(type) Support array as FieldValue
6 changes: 2 additions & 4 deletions packages/formspree-core/src/submission.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,8 @@ import type { UnknownObject } from './utils';

export type SubmissionData<T extends FieldValues = FieldValues> = FormData | T;

export type FieldValues = Record<
string,
string | number | boolean | null | undefined
>;
export type FieldValues = Record<string, FieldValue | FieldValue[]>;
type FieldValue = string | number | boolean | null | undefined;

export type SubmissionOptions = {
clientName?: string;
Expand Down

1 comment on commit 6c31cd1

@vercel
Copy link

@vercel vercel bot commented on 6c31cd1 Sep 14, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.