Closed juanparati closed 8 months ago
@juanparati tests fail here
@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.
This is the solution to https://github.com/laravel/precognition/issues/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.