precognition icon indicating copy to clipboard operation
precognition copied to clipboard

Extended original InertiaJS props and method types into PrecognitionFormProps

Open juanparati opened this issue 8 months ago • 1 comments

I was able to extend original InertiaJS props and methods types into the PrecognitionFormProps, so Typescript linters can provide scope over the original InertiaFormProps.

This method is better that proposed in https://github.com/laravel/precognition/pull/71 because it's not required to wrap methods for InertiaJS.

Advantages:

  • It will automatically inherit automatically all methods and props from different InertiaJS versions.
  • Easy to maintain, it only requires to write definitions for the resulted object of Precognition "useForm".

juanparati avatar Jun 20 '24 07:06 juanparati