Closed denno020 closed 2 years ago
Sorry accidentally clicked the close button 😞
This is far from true. Informed has the ability to have inputs that store anything from dates to complex objects. It was unknown by design. In addition you can have highly nested value states and arrays. See the docs for examples.
Describe the bug The FormState type in
index.d.ts
is currently using Record types with<string, unknown>
. I don't believe the value isunknown
, it's always going to be a string, as we're dealing with form inputs right? Informed has always assumed that the value passed into an input is a string, even if they're numbers, they're always treated as a string.. At least that has been my experience.To Reproduce This is a super simple Sandbox that simply shows the error that Typescript will display because the type information for the (in this case) values object is defined as
<string, unknown>
. We can also see the Typescript errors becuase Form and Input don't have type declarations, which is very annoying, but there is another issue related to that.https://codesandbox.io/s/informed-js-types-bug-1lxwt