Skip to content
This repository was archived by the owner on Jun 15, 2022. It is now read-only.

Commit e0a49e8

Browse files
authored
Merge pull request #11 from react-hook-form/improve/UnpackNestedValue
improve UnpackNestedValue type
2 parents a2eb93a + 5b36136 commit e0a49e8

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/types.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,8 @@ export type NonUndefined<T> = T extends undefined ? never : T;
108108

109109
export type UnpackNestedValue<T> = NonUndefined<T> extends NestedValue<infer U>
110110
? U
111+
: NonUndefined<T> extends Date | FileList
112+
? T
111113
: NonUndefined<T> extends object
112114
? { [K in keyof T]: UnpackNestedValue<T[K]> }
113115
: T;

0 commit comments

Comments
 (0)