inertia-react-development_skill

This skill helps you build Inertia.js v2 React applications, enabling pages, forms, and navigation with deferred props, prefetching, and polling.
  • Rust

364

GitHub Stars

1

Bundled Files

2 months ago

Catalog Refreshed

4 months ago

First Indexed

Readme & install

Copy the install command, review bundled files from the catalogue, and read any extended description pulled from the listing source.

Installation

Preview and clipboard use veilstrat where the catalogue uses aiagentskills.

npx veilstrat add skill openagentsinc/openagents --skill inertia-react-development

  • SKILL.md9.6 KB

Overview

This skill develops Inertia.js v2 React client applications, focusing on pages, navigation, forms, and client-side patterns. It activates when you work with <Link>, <Form>, useForm, router visits, deferred props, prefetching, polling, or other Inertia React features. The guidance optimizes SPA behavior, performance patterns, and common pitfalls.

How this skill works

The skill inspects React page structure and recommends Inertia-specific primitives: <Link> for client navigation, <Form> or useForm for submissions, router.visit for programmatic navigation, and hooks like usePoll and useForm for polling and state. It also checks for v2 features such as deferred props, prefetch flags, WhenVisible infinite scroll, and form reset behaviors to suggest loading states and error handling.

When to use it

  • Creating or updating React page components under resources/js/pages
  • Implementing client-side navigation or replacing <a> with <Link>
  • Building forms using <Form> or using the useForm hook for programmatic control
  • Adding Inertia v2 features: deferred props, prefetching, polling, or WhenVisible infinite scroll
  • Implementing programmatic visits with router.visit or method-based Link submissions

Best practices

  • Always use <Link> for internal navigation to preserve SPA behavior and preserve scroll/state
  • Show loading skeletons or placeholders when using deferred props; handle undefined data explicitly
  • Prefer <Form> for simple forms and useForm for complex programmatic flows (reset, setData, error handling)
  • Use prefetch on links for perceived performance and restrict heavy prefetching to key routes
  • When polling, use usePoll with appropriate interval, consider autoStart and keepAlive for tab behavior
  • Prevent default native form submission when not using Inertia <Form>; ensure version compatibility for component availability

Example use cases

  • User index page with deferred users prop showing skeleton while data loads
  • Create/edit user form built with <Form> to leverage processing, errors, and reset behaviors
  • Programmatic navigation after an action using router.visit with onSuccess callbacks
  • Prefetching key dashboard pages via <Link prefetch> to reduce perceived latency
  • Dashboard auto-refresh using usePoll with manual start/stop and throttling when tab is inactive

FAQ

Use <Form> for simple declarative forms that need built-in processing and reset behavior. Use useForm when you need programmatic control over data, partial resets, or custom submit flows.

How do I handle deferred props in components?

Render a skeleton or fallback UI when the prop is undefined, then render the real data once it arrives. Always guard against undefined to avoid runtime errors.

Built by
VeilStrat
AI signals for GTM teams
© 2026 VeilStrat. All rights reserved.All systems operational
inertia-react-development skill by openagentsinc/openagents | VeilStrat