Skip to content

Commit

Permalink
fix: arrays with null default values should no longer throw (#782)
Browse files Browse the repository at this point in the history
  • Loading branch information
crutchcorn authored Jun 27, 2024
1 parent 715704e commit 2f61d25
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/react-form/src/useField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ export function useField<
fieldApi.store,
opts.mode === 'array'
? (state) => {
return [state.meta, Object.keys(state.value as never).length]
return [state.meta, Object.keys(state.value ?? []).length]
}
: undefined,
)
Expand Down

0 comments on commit 2f61d25

Please sign in to comment.