---
title: "Inertia v3 with React"
description: "Inertia v3 patterns in the React kit: how pages receive data, the Form component, useForm, visits, shared props, flash toasts and typed Wayfinder routes."
---
# Inertia
The kit runs on Inertia v3 (`@inertiajs/react` ^3, `inertiajs/inertia-laravel` ^3). We don't use Axios or a separate API. A request is always an Inertia visit, a `
```
A handful of other `
```
Both `transformLocale` and `toLocaleValue` are exported from `hooks/use-language.ts`.
:::
::: details View create/edit in one modal (user-form-modal.tsx)
Depending on whether a user is selected, the modal uses `store.form()` or `update.form(id)`, and `key` forces the form to re-mount when that changes. The page opens and closes it through `open()` / `close()`, exposed with `useImperativeHandle` (`UserFormModalHandle`).
```tsx
const formAction = selectedUser ? update.form(selectedUser.id) : store.form();
```
:::
### `useForm` for custom inputs
If a form isn't made of native inputs, switch to `useForm`. That's what the card pickers on Settings → Layout and Setup → Layout do. Clicking a card calls `setData()`, and saving submits with `patch(update.url(), { onSuccess: () => setDefaults() })`.
::: details View useForm example (settings/layout.tsx)
```tsx
import { useForm } from '@inertiajs/react';
import { update } from '@/routes/layout';
const { data, setData, patch, processing, isDirty, reset, setDefaults } = useForm({
app_layout: layoutSettings?.app_layout || 'sidebar',
sidebar_variant: layoutSettings?.sidebar_variant || 'inset',
sidebar_collapsible: layoutSettings?.sidebar_collapsible || 'icon',
});
const submit = (event: FormEvent) => {
event.preventDefault();
patch(update.url(), {
preserveScroll: true,
onSuccess: () => setDefaults(),
});
};
```
:::
## Visits, links and requests
Forms go through `