diff --git a/packages/antd/src/array-base/index.tsx b/packages/antd/src/array-base/index.tsx index c48f549c9b2..efb1ca4f860 100644 --- a/packages/antd/src/array-base/index.tsx +++ b/packages/antd/src/array-base/index.tsx @@ -91,7 +91,7 @@ const useIndex = (index?: number) => { const useRecord = (record?: number) => { const ctx = useContext(ItemContext) - return takeRecord(ctx ? ctx.record : record, ctx.index) + return takeRecord(ctx ? ctx.record : record, ctx?.index) } const getSchemaDefaultValue = (schema: Schema) => { diff --git a/packages/next/src/array-base/index.tsx b/packages/next/src/array-base/index.tsx index cce0c726ab4..4be16abf574 100644 --- a/packages/next/src/array-base/index.tsx +++ b/packages/next/src/array-base/index.tsx @@ -91,7 +91,7 @@ const useIndex = (index?: number) => { const useRecord = (record?: number) => { const ctx = useContext(ItemContext) - return takeRecord(ctx ? ctx.record : record, ctx.index) + return takeRecord(ctx ? ctx.record : record, ctx?.index) } const getSchemaDefaultValue = (schema: Schema) => {