Skip to content

Commit 47e82db

Browse files
committed
Docs about callbacks in Client Side Visits params
see inertiajs/inertiajs.com#436
1 parent 0a104ea commit 47e82db

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

docs/guide/manual-visits.md

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -417,6 +417,10 @@ router.push({
417417
encryptHistory: false,
418418
preserveScroll: false,
419419
preserveState: false,
420+
errorBag: null,
421+
onSuccess: (page) => {},
422+
onError: (errors) => {},
423+
onFinish: (visit) => {},
420424
})
421425
```
422426

@@ -433,6 +437,10 @@ router.push({
433437
encryptHistory: false,
434438
preserveScroll: false,
435439
preserveState: false,
440+
errorBag: null,
441+
onSuccess: (page) => {},
442+
onError: (errors) => {},
443+
onFinish: (visit) => {},
436444
})
437445
```
438446

@@ -449,15 +457,21 @@ router.push({
449457
encryptHistory: false,
450458
preserveScroll: false,
451459
preserveState: false,
460+
errorBag: null,
461+
onSuccess: (page) => {},
462+
onError: (errors) => {},
463+
onFinish: (visit) => {},
452464
})
453465
```
454466

455467
:::
456468

457-
All the parameters are optional. By default, all passed parameters will be merged with the current page. This means you are responsible for overriding the current page's URL, component, and props.
469+
All the parameters are optional. By default, all passed parameters (except `errorBag`) will be merged with the current page. This means you are responsible for overriding the current page's URL, component, and props.
458470

459471
If you need access to the current page's props you can pass a function to the props option. This function will receive the current page's props as an argument and should return the new props.
460472

473+
The `errorBag` option allows you to specify which error bag to use when handling validation errors in the `onError` callback.
474+
461475
:::tabs key:frameworks
462476
== Vue
463477

0 commit comments

Comments
 (0)