-
Notifications
You must be signed in to change notification settings - Fork 174
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TypeScript - Examples of using unknown types? #425
Comments
I personally dont use typescript but what I do know is in trying to make the types NOT unknown from informed when you get nested forms it becomes hell on earth. If some Typescript GURU wanted to come in and help me figure out better way to do it im all ears but even within my company I had a few TS people go back and forth on different solutions and never came to consensus ( ONE OF THE REASONS I HATE TS SO F$%ing much... you ask 3 devs how to type something you get three answers ) ... Ryan do you miss my energy?? lmao |
@joepuzzo Is it possible to share a nested forms instance that we could use to hack types against? In my projects, we're manually typing
which works for my immediate issue, but I am by no means a TS guru. I too have been very resistant to TS, as it makes source code super ugly, but the code completion it offers is hard to ignore - and I guess the static type checking, but I find myself mostly fighting that, and only loving code completion. |
haha Its funny because Sooo many people I talk to share your exact same opinion on TS. Only really love it for the code completion. I share that sentiment. What do you mean exactly by "share a nested forms instance" ? |
From your comment above:
I assume you mean something like:
But wanted to make sure? |
Are there any examples of how to use types properly using the
unknown
type? Struggling with getting informed v4 set up in my project.Specifically some advice on how to type
useField
/useState
stuff so it's notunknown
:const { fieldState, fieldApi } = useField<string, string>(props);
is what i tried, it (the compiler) accepts that line, but using
fieldState.value
returns anunknown
type which doesn't play well with other types.Thank you in advance!
The text was updated successfully, but these errors were encountered: