Closed nighca closed 2 years ago
So that ValueOf supports any state (other than FieldState & FormState) which correctly implemented Validatable.
ValueOf
FieldState
FormState
Validatable
For code:
const fooState: Validatable<string> = ... const formState = new FormState({ foo: fooState }) typeof fooState.value.foo // expected to be `string`
Without this PR, typeof fooState.value.foo will be derived as never.
typeof fooState.value.foo
never
With this PR, it will be derived as string as expected
string
So that
ValueOf
supports any state (other thanFieldState
&FormState
) which correctly implementedValidatable
.For code:
Without this PR,
typeof fooState.value.foo
will be derived asnever
.With this PR, it will be derived as
string
as expected