Skip to content

Commit

Permalink
fix: infer correct value types in Custom fields
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisvxd committed Apr 24, 2024
1 parent 061cc2a commit 5c8c0e1
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions packages/core/types/Config.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -104,14 +104,12 @@ export type ExternalField<
initialFilters?: Record<string, any>;
};

export type CustomField<
Props extends { [key: string]: any } = { [key: string]: any }
> = BaseField & {
export type CustomField<Props extends any = {}> = BaseField & {
type: "custom";
render: (props: {
field: CustomField;
field: CustomField<Props>;
name: string;
value: any;
value: Props;
onChange: (value: Props) => void;
readOnly?: boolean;
}) => ReactElement;
Expand All @@ -129,7 +127,7 @@ export type Field<
| ObjectField<Props>
| ExternalField<Props>
| ExternalFieldWithAdaptor<Props>
| CustomField;
| CustomField<Props>;

export type DefaultRootProps = {
title?: string;
Expand Down

0 comments on commit 5c8c0e1

Please sign in to comment.