Skip to content
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

Vue + Inertia useForm now uses an object compatible signature #64

Closed
wants to merge 2 commits into from
Closed

Vue + Inertia useForm now uses an object compatible signature #64

wants to merge 2 commits into from

Conversation

juanparati
Copy link

This is the solution to #63.

The signature for "useForm" (Vue + InertiaJS package) was changed to object instead of Record<string, unknown> so it's going to be compatible with the native InertiaJS "useForm" that accepts also an object (type FormDataType = object).

"usePrecognitiveForm" type was hydrated as Record<string, unknown> so it should not break the compatibility.

Record<string, unknown> it's basically an object, so everything should work as expected.

I did a test with with Typescript 5.3.3.

@taylorotwell taylorotwell marked this pull request as draft January 25, 2024 15:19
@driesvints
Copy link
Member

@juanparati tests fail here

@juanparati juanparati marked this pull request as ready for review January 26, 2024 07:36
@juanparati
Copy link
Author

@driesvints : I had to suppress incompatible type errors for inertiaClearErrors and inertiaReset. I could not change the parameters signature for the "reset" method because precognitiveForm.setErrors uses Record<string, unknown> and it's a main precognition method. If I change the setErrors signature for the method I will break other packages.

I will see if I can come in the following days with a more elegant solution that can also fix the issue with the useForm return type and I will submit a new pull request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants