inertia-react-development

Implements Inertia.js v3 React pages, forms, navigation, and client-side data features.

Updated Sep 5, 2025
One-click install
npx skills add https://github.com/baubyte/website --skill inertia-react-development-baubyte
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: inertia-react-development
Source: https://github.com/baubyte/website/tree/main/.agents/skills/inertia-react-development
Command: npx skills add https://github.com/baubyte/website --skill inertia-react-development-baubyte

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires @inertiajs/react.

What problem does it solve? Building React frontends on top of a server-driven Inertia.js backend requires knowing the correct v3 APIs for pages, forms, navigation, and data loading; this Skill provides those patterns so you avoid broken SPA behavior and outdated v2 conventions. ## Core Features & Use Cases - Page Components & Navigation: Create React page components in resources/js/Pages and navigate with <Link>, router.visit, and prefetching instead of traditional <a> tags. - Form Handling: Build forms with the <Form> component or the useForm hook, including error display, processing states, reset-on-success, and file upload progress. - Inertia v3 Features: Use useHttp for plain JSON requests, optimistic updates, instant visits, setLayoutProps, deferred props, usePoll, WhenVisible, and InfiniteScroll. - Use Case: When adding a user creation page to a Laravel + Inertia + React app, use this Skill to scaffold the page component, wire up a <Form> with validation errors, and add prefetching to the navigation links. ## Quick Start Create an Inertia React page component with a form that posts to /users and shows validation errors using the Form component.

Frequently Asked Questions about inertia-react-development

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I create a form in Inertia React?▼

Use the `<Form>` component from @inertiajs/react with an action and method, accessing errors, processing, and wasSuccessful via its render prop. For programmatic control, use the `useForm` hook with data, setData, and post.

How do I navigate between pages in Inertia React?▼

Use the `<Link>` component from @inertiajs/react instead of `<a>` tags to preserve SPA behavior. For programmatic navigation, call `router.visit('/users')` with optional method, data, and callbacks.

What is the difference between useForm and useHttp in Inertia v3?▼

useForm submits data as Inertia visits that trigger page transitions, while useHttp sends standalone requests to plain JSON endpoints without triggering an Inertia page visit. Both share a similar API with data, setData, and processing state.

Does Inertia React support optimistic updates?▼

Yes, Inertia v3 supports optimistic updates via `router.optimistic()` or the `optimistic` prop on `<Form>`. The UI updates instantly before the server responds and rolls back automatically on failure.

Why is my Inertia React form submitting as a full page reload?▼

This happens when using a plain `<form>` element without preventing the default submission. Use the `<Form>` component or call `e.preventDefault()` in your submit handler with useForm.

What changed in Inertia v3 for router cancellation and error events?▼

In v3, `router.cancel()` was replaced by `router.cancelAll()`, and the `invalid` and `exception` router events were renamed to `httpException` and `networkError`. Update event listeners accordingly when migrating.