-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
⌨️ refactor UseFormMethods to arrow functions #2899
⌨️ refactor UseFormMethods to arrow functions #2899
Conversation
1af6feb
to
6974f3e
Compare
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit 6da53e6:
|
6974f3e
to
1ec110a
Compare
I got the main issue down, but I don't understand why TypeScript complains about generics in multiple invocation signatures while it was fine using overloaded functions :| |
Thanks @Tymek I will take a look at it. |
actually @kotarella1110 did you had a similar issue before? I remember from one of the PR. it was to do with the type order. is this a result of cycle reference with |
@bluebill1049 yes. I had a similar problem before (please see #1412 (comment)). |
Thanks @kotarella1110 i will play with it a bit more. |
I am having issue to get this one over the line as well, attached with help wanted tag, hopefully someone can figure out the reason and i will take a look at it again as well. |
my 🧠 is fried... @kotarella1110 if you some free time, please help to take a look at this... |
I did some more debugging and.. this is madness maybe we can create matching Control from |
I have no idea why tests passed locally, but I had the same problem. I sidestepped it with |
@Tymek I got my 🧠 fried by this issue... I couldn't find a clue why tests failed everyone and then, while e2e constantly(build) failed. I am not even sure it's our code or ts... |
This is the only time we could probably say that |
Thanks for trying to solve this "hard" problem @Tymek 🙏 ❤️ |
Your're welcome 😉 I'm glad that I can help CI tests finally passed 🎉 |
oh wow! thank you! the power of OSS. |
@@ -7,8 +7,7 @@ import skipValidation from './logic/skipValidation'; | |||
import isNameInFieldArray from './logic/isNameInFieldArray'; | |||
import { useFormContext } from './useFormContext'; | |||
import { VALUE } from './constants'; | |||
import { Control } from './types'; | |||
import { ControllerProps } from './types'; | |||
import { ControllerProps, FieldValues } from './types'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice~
}: ControllerProps<TAs, TControl>) => { | ||
const methods = useFormContext(); | ||
}: ControllerProps<TAs, TFieldValues>) => { | ||
const methods = useFormContext<TFieldValues>(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in theory changing this might break someone's build, but it's a niche case
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wow! amazing 🏆
looks so good! 💯
Thank you very much!!!!!
Thank you very much @Tymek 🎖️ and @kotarella1110 for the review. 🙏 |
This reverts commit 3d713b3.
Looks like this PR caused some issues... I am temporally rever it back 🙏 |
resolves #2887