Skip to content

Commit

Permalink
fix(antd/next): fix array base use record null error (#3380)
Browse files Browse the repository at this point in the history
  • Loading branch information
charlzyx authored Sep 8, 2022
1 parent 5587282 commit 053e0f0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/antd/src/array-base/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down
2 changes: 1 addition & 1 deletion packages/next/src/array-base/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down

0 comments on commit 053e0f0

Please sign in to comment.