Skip to content

Commit 21f4103

Browse files
committed
Allow unknown values as part of PreloadedState type
Without this, a state type that contains a nested `unknown` field will cause errors like: > Types of property 'x' are incompatible. > Type 'unknown' is not assignable to type 'undefined'.ts(2345)
1 parent cf2f265 commit 21f4103

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

index.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ export type PreloadedState<S> = Required<S> extends EmptyObject
6868
}
6969
: never
7070
: {
71-
[K in keyof S]: S[K] extends string | number | boolean | symbol
71+
[K in keyof S]: S[K] extends string | number | boolean | symbol | unknown
7272
? S[K]
7373
: PreloadedState<S[K]>
7474
}

0 commit comments

Comments
 (0)