Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/react/src/useForm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import useRemember from './useRemember'
type setDataByObject<TForm> = (data: TForm) => void
type setDataByMethod<TForm> = (data: (previousData: TForm) => TForm) => void
type setDataByKeyValuePair<TForm> = <K extends keyof TForm>(key: K, value: TForm[K]) => void
type FormDataType = Record<string, FormDataConvertible>
type FormDataType = Partial<Record<string, FormDataConvertible>>
Copy link
Author

@matthiasweiss matthiasweiss Feb 24, 2025

Choose a reason for hiding this comment

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

If you prefer, I think we could also go for this notation, I don't mind either one.

Suggested change
type FormDataType = Partial<Record<string, FormDataConvertible>>
type FormDataType = { [key:string]?: FormDataConvertible }

type FormOptions = Omit<VisitOptions, 'data'>

export interface InertiaFormProps<TForm extends FormDataType> {
Expand Down
Loading