File tree 2 files changed +18
-11
lines changed
packages/ra-core/src/form
2 files changed +18
-11
lines changed Original file line number Diff line number Diff line change @@ -153,21 +153,24 @@ const FormWithRedirect: FC<FormWithRedirectProps> = ({
153
153
export type FormWithRedirectProps = FormWithRedirectOwnProps &
154
154
Omit < FormProps , 'onSubmit' | 'active' > ;
155
155
156
+ export type FormWithRedirectRender = (
157
+ props : Omit < FormViewProps , 'render' | 'setRedirect' >
158
+ ) => React . ReactElement < any , any > ;
159
+
160
+ export type FormWithRedirectSave = (
161
+ data : Partial < Record > ,
162
+ redirectTo : RedirectionSideEffect ,
163
+ options ?: {
164
+ onSuccess ?: ( data ?: any ) => void ;
165
+ onFailure ?: ( error : any ) => void ;
166
+ }
167
+ ) => void ;
156
168
export interface FormWithRedirectOwnProps {
157
169
defaultValue ?: any ;
158
170
record ?: Record ;
159
171
redirect ?: RedirectionSideEffect ;
160
- render : (
161
- props : Omit < FormViewProps , 'render' | 'setRedirect' >
162
- ) => React . ReactElement < any , any > ;
163
- save ?: (
164
- data : Partial < Record > ,
165
- redirectTo : RedirectionSideEffect ,
166
- options ?: {
167
- onSuccess ?: ( data ?: any ) => void ;
168
- onFailure ?: ( error : any ) => void ;
169
- }
170
- ) => void ;
172
+ render : FormWithRedirectRender ;
173
+ save ?: FormWithRedirectSave ;
171
174
sanitizeEmptyValues ?: boolean ;
172
175
saving ?: boolean ;
173
176
version ?: number ;
Original file line number Diff line number Diff line change @@ -7,6 +7,8 @@ import FormContext from './FormContext';
7
7
import FormField from './FormField' ;
8
8
import FormWithRedirect , {
9
9
FormWithRedirectProps ,
10
+ FormWithRedirectRender ,
11
+ FormWithRedirectSave ,
10
12
HandleSubmitWithRedirect ,
11
13
} from './FormWithRedirect' ;
12
14
import useInput , { InputProps , UseInputValue } from './useInput' ;
@@ -29,6 +31,8 @@ export type {
29
31
FormDataConsumerRender ,
30
32
FormDataConsumerRenderParams ,
31
33
FormWithRedirectProps ,
34
+ FormWithRedirectRender ,
35
+ FormWithRedirectSave ,
32
36
HandleSubmitWithRedirect ,
33
37
InputProps ,
34
38
UseInputValue ,
You can’t perform that action at this time.
0 commit comments