Skip to content

Commit e282e45

Browse files
refactor: improve code readability
1 parent 0d18ec0 commit e282e45

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

packages/ra-core/src/form/FormDataConsumer.tsx

+5
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ const FormDataConsumer = <TFieldValues extends FieldValues = FieldValues>(
6363
<FormDataConsumerView<TFieldValues> formData={formData} {...props} />
6464
);
6565
};
66+
6667
export const FormDataConsumerView = <
6768
TFieldValues extends FieldValues = FieldValues,
6869
TPathValue = PathValue<TFieldValues, Path<TFieldValues>>[]
@@ -85,23 +86,27 @@ export const FormDataConsumerView = <
8586
};
8687

8788
export default FormDataConsumer;
89+
8890
export interface FormDataConsumerRenderParams<
8991
TFieldValues extends FieldValues = FieldValues
9092
> {
9193
formData: TFieldValues;
9294
scopedFormData?: any;
9395
getSource?: (source: string) => string;
9496
}
97+
9598
export type FormDataConsumerRender<
9699
TFieldValues extends FieldValues = FieldValues
97100
> = (params: FormDataConsumerRenderParams<TFieldValues>) => ReactNode;
101+
98102
interface ConnectedProps<TFieldValues extends FieldValues = FieldValues> {
99103
children: FormDataConsumerRender<TFieldValues>;
100104
form?: string;
101105
record?: any;
102106
source?: string;
103107
[key: string]: any;
104108
}
109+
105110
interface Props<TFieldValues extends FieldValues> extends ConnectedProps {
106111
formData: TFieldValues;
107112
index?: number;

0 commit comments

Comments
 (0)