@php /** @var \Laravel\Boost\Install\GuidelineAssist $assist */ @endphp ## Inertia + React Forms @if($assist->inertia()->hasFormComponent()) @boostsnippet("`
) @endboostsnippet @endif @if($assist->inertia()->hasFormComponent() === false) {{-- Inertia 2.0.x, not 2.1.0 or higher. So they still need to use 'useForm' --}} @boostsnippet("Inertia React useForm Example", "react") import { useForm } from '@inertiajs/react' const { data, setData, post, processing, errors } = useForm({ email: '', password: '', remember: false, }) function submit(e) { e.preventDefault() post('/login') } return ( ) @endboostsnippet @endif