Skip to content

Commit 84bbc88

Browse files
committed
Update UPGRADE.md
1 parent 273285f commit 84bbc88

File tree

1 file changed

+2
-10
lines changed

1 file changed

+2
-10
lines changed

UPGRADE.md

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -142,17 +142,9 @@ Inertia makes use of a `require()` call that is more complex to replicate with V
142142

143143
The following function can be used instead:
144144

145-
```js
146-
function resolvePageComponent(path, pages) {
147-
if (typeof pages[path] === undefined) {
148-
throw new Error(`Page not found: ${path}`)
149-
}
150-
151-
return pages[path]()
152-
}
153-
```
154-
155145
```diff
146+
+ import { resolvePageComponent } from 'laravel-vite-plugin/inertia-helpers'
147+
156148
createInertiaApp({
157149
title: (title) => `${title} - ${appName}`,
158150
- resolve: (name) => require(`./Pages/${name}.vue`),

0 commit comments

Comments
 (0)