Skip to content

Commit b859be7

Browse files
committed
working on guidelines
1 parent eb77018 commit b859be7

File tree

2 files changed

+16
-6
lines changed

2 files changed

+16
-6
lines changed

.ai/inertia-react/core.blade.php

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
1+
## Inertia + React
2+
13
- Use `router.visit()` or `<Link>` for navigation instead of traditional links.
2-
<code-snippet lang="react" name="Inertia client navigation">
4+
5+
<code-snippet lang="react" name="Inertia Client Navigation">
36
import { Link } from '@inertiajs/react'
47

58
<Link href="/">Home</Link>
69
</code-snippet>
710

8-
- For form handling, use `router.post` and related methods, do not use regular forms.
9-
<code-snippet lang="react" name="Form example">
11+
- For form handling, use `router.post` and related methods. Do not use regular forms.
12+
13+
<code-snippet lang="react" name="Inertia React Form Example">
1014
import { useState } from 'react'
1115
import { router } from '@inertiajs/react'
1216

@@ -20,6 +24,7 @@
2024
function handleChange(e) {
2125
const key = e.target.id;
2226
const value = e.target.value
27+
2328
setValues(values => ({
2429
...values,
2530
[key]: value,
@@ -28,6 +33,7 @@ function handleChange(e) {
2833

2934
function handleSubmit(e) {
3035
e.preventDefault()
36+
3137
router.post('/users', values)
3238
}
3339

.ai/inertia-vue/core.blade.php

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,18 @@
1+
## Inertia + Vue
2+
13
- Vue components must have a single root element.
24
- Use `router.visit()` or `<Link>` for navigation instead of traditional links.
3-
<code-snippet lang="vue" name="Inertia client navigation">
5+
6+
<code-snippet lang="vue" name="Inertia Client Navigation">
47
import { Link } from '@inertiajs/vue3'
58

69
<Link href="/">Home</Link>
710
</code-snippet>
811

9-
- For form handling, use `router.post` and related methods, do not use regular forms.
12+
- For form handling, use `router.post` and related methods. Do not use regular forms.
13+
1014
@verbatim
11-
<code-snippet lang="vue" name="Form example">
15+
<code-snippet lang="vue" name="Inertia Vue Form Example">
1216
<script setup>
1317
import { reactive } from 'vue'
1418
import { router } from '@inertiajs/vue3'

0 commit comments

Comments
 (0)