Skip to content

Commit b238b49

Browse files
authored
fix(form): add formInstance for no deps Form.Item (#576)
1 parent 07e27b9 commit b238b49

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/form/table.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,8 @@ export default function InternalTable({
120120
...restProps
121121
} = tableProps;
122122

123+
const formInstance = Form.useFormInstance();
124+
123125
const convertRawToTableCol = (raw?: ColumnType[]): ColumnsType<FormListFieldData> => {
124126
if (!raw?.length) return [];
125127
return raw.map(
@@ -201,7 +203,7 @@ export default function InternalTable({
201203

202204
return (
203205
<Form.Item name={currentNamePath} rules={rules} {...formItemProps}>
204-
{render?.(record, currentNamePath)}
206+
{render?.(record, currentNamePath, formInstance)}
205207
</Form.Item>
206208
);
207209
},

0 commit comments

Comments
 (0)