Skip to content

Commit

Permalink
fix(form): ProFormDependency support T
Browse files Browse the repository at this point in the history
close #6040
  • Loading branch information
chenshuai2144 committed Oct 11, 2022
1 parent 0ebd3db commit 7b0c85d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions packages/form/src/components/Dependency/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,21 @@ declare type RenderChildren<Values = any> = (
form: ProFormInstance<Values>,
) => React.ReactNode;

export type ProFormDependencyProps = Omit<
export type ProFormDependencyProps<T = Record<string, any>> = Omit<
FormItemProps<any>,
'name' | 'noStyle' | 'children' | 'label'
> & {
name: NamePath[];
ignoreFormListField?: boolean;
children: RenderChildren;
children: RenderChildren<T>;
};

const ProFormDependency: React.FC<ProFormDependencyProps> = ({
const ProFormDependency = <T,>({
name: names,
children,
ignoreFormListField,
...rest
}) => {
}: ProFormDependencyProps<T>) => {
const context = useContext(ProFormContext);
// ProFromList 的 field,里面有name和key
const formListField = useContext(FormListContext);
Expand Down

0 comments on commit 7b0c85d

Please sign in to comment.