Skip to content

Commit

Permalink
CreateGuesser / EditGuesser formId attribute
Browse files Browse the repository at this point in the history
  • Loading branch information
PawelSuwinski committed Mar 27, 2024
1 parent 9993bf1 commit 95678d7
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/CreateGuesser.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ export const IntrospectedCreateGuesser = ({
toolbar,
warnWhenUnsavedChanges,
sanitizeEmptyValues = true,
formId,
formComponent,
viewComponent,
children,
Expand Down Expand Up @@ -165,6 +166,7 @@ export const IntrospectedCreateGuesser = ({
return (
<Create resource={resource} component={viewComponent} {...props}>
<FormType
id={formId}
onSubmit={save}
mode={mode}
defaultValues={defaultValues}
Expand Down
2 changes: 2 additions & 0 deletions src/EditGuesser.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ export const IntrospectedEditGuesser = ({
transform,
toolbar,
warnWhenUnsavedChanges,
formId,
formComponent,
viewComponent,
sanitizeEmptyValues = true,
Expand Down Expand Up @@ -205,6 +206,7 @@ export const IntrospectedEditGuesser = ({
})}
{...props}>
<FormType
id={formId}
onSubmit={mutationMode !== 'pessimistic' ? undefined : save}
mode={mode}
defaultValues={defaultValues}
Expand Down
3 changes: 3 additions & 0 deletions src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import type {
DeleteResult,
EditProps,
EmailFieldProps,
FormProps,
GET_LIST,
GET_MANY,
GET_MANY_REFERENCE,
Expand Down Expand Up @@ -371,6 +372,7 @@ type CreateFormProps = Omit<
CreateProps & SimpleFormProps & TabbedFormProps,
'children'
> &
Partial<PickRename<FormProps, 'id', 'formId'>> &
Partial<PickRename<CreateProps, 'component', 'viewComponent'>> &
Partial<
PickRename<SimpleFormProps & TabbedFormProps, 'component', 'formComponent'>
Expand All @@ -391,6 +393,7 @@ type EditFormProps = Omit<
'children'
> &
Partial<PickRename<EditProps, 'component', 'viewComponent'>> &
Partial<PickRename<FormProps, 'id', 'formId'>> &
Partial<
PickRename<SimpleFormProps & TabbedFormProps, 'component', 'formComponent'>
> & {
Expand Down

0 comments on commit 95678d7

Please sign in to comment.