How to Creating Reusable Forms with TypeScript #12360
Unanswered
jun2077681
asked this question in
Q&A
Replies: 1 comment
-
somebody help me.. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Question: Issue with
validate
type inference in reusable TypeScript formsI am trying to create reusable forms with TypeScript.
In the
registerOptions
'svalidate
function, thevalue
type is not being inferred correctly, so I would like to ask for a solution.Below is my code:
I am trying to use the code as follows:
In the isValid function for startDate and endDate, I expected the value to be inferred as Date, but it is actually inferred as string | number | Date, which includes all possible types of ScheduleDto values. Is there a solution to this problem?
Beta Was this translation helpful? Give feedback.
All reactions