Skip to content

Commit 8d459e4

Browse files
committed
feat: expose CustomFieldRender type for custom field render functions
1 parent 5417a33 commit 8d459e4

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed

packages/core/types/Fields.ts

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -106,16 +106,18 @@ export type ExternalField<
106106
initialFilters?: Record<string, any>;
107107
};
108108

109-
export type CustomField<Props extends any = {}> = BaseField & {
109+
export type CustomFieldRender<Value extends any> = (props: {
110+
field: CustomField<Value>;
111+
name: string;
112+
id: string;
113+
value: Value;
114+
onChange: (value: Value) => void;
115+
readOnly?: boolean;
116+
}) => ReactElement;
117+
118+
export type CustomField<Value extends any> = BaseField & {
110119
type: "custom";
111-
render: (props: {
112-
field: CustomField<Props>;
113-
name: string;
114-
id: string;
115-
value: Props;
116-
onChange: (value: Props) => void;
117-
readOnly?: boolean;
118-
}) => ReactElement;
120+
render: CustomFieldRender<Value>;
119121
};
120122

121123
export type SlotField = BaseField & {

0 commit comments

Comments
 (0)