Skip to content

Conversation

joetannenbaum
Copy link
Contributor

This PR utilizes the new Inertia Form component on all screens where it makes the most sense, reducing boilerplate.

@jrd-lewis
Copy link
Contributor

Shouldn't the onFinish methods from the previous useForm go to @finish on the new Form component instead of @submit-complete?

@joetannenbaum
Copy link
Contributor Author

@jrd-lewis this is a trade-off we decided to take for the sake of long term consistency without possible breaking changes.

@finish is equivalent to onFinish in the original, but it doesn't have access to the reset method, which is specific to the form. So we added a new @submit-complete that allows you to tap into form-specific methods and clean up if you need to.

@joetannenbaum joetannenbaum marked this pull request as ready for review August 15, 2025 19:21
@joetannenbaum joetannenbaum merged commit ad7570a into main Aug 15, 2025
2 checks passed
@pushpak1300 pushpak1300 deleted the inertia-form-component branch August 27, 2025 09:15
@kaspernowak
Copy link

@joetannenbaum How would we use Laravel Precognition with the Inertia <Form> component?
The Laravel Precognition documentation recommends using the starter kits, but it's usage seems to be exclusively tied to useForm:

Precognition pairs especially well with Laravel's Inertia-based starter kits.

With the Laravel Precognition package installed, you can now create a form object using Precognition's useForm function, providing the HTTP method (post), the target URL (/users), and the initial form data.

@kaspernowak
Copy link

@joetannenbaum I added a PR to the Laravel Precognition repo to implement a precognitive Form / PrecognitionForm component.

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.

3 participants