Skip to content

Commit

Permalink
fix: setValue should accept null (#120)
Browse files Browse the repository at this point in the history
setValue(null) throws errors, because typeof null is 'object' and  `"__isResetting" in null` is not allowed.
  • Loading branch information
oyzhen committed Aug 30, 2023
1 parent 2a8e3ec commit db8e055
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions lib/field/use-field-like.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 21,7 @@ export type InternalValue<T> = {
export const isInternal = <T>(value: any): value is InternalValue<T> => {
return (
!Array.isArray(value) &&
value !== null &&
typeof value === "object" &&
"__isResetting" in value
);
Expand Down

0 comments on commit db8e055

Please sign in to comment.