You've already forked Atomcms-edit
feat: install and configure Inertia.js with React
- Install inertia-laravel, @inertiajs/react, react, @vitejs/plugin-react - Add HandleInertiaRequests middleware registered in web group - Create Inertia root template (resources/views/app.blade.php) - Add React entry point and page components (resources/js/) - Add Inertia demo route (/inertia-test) - HomeController reverted to Blade (index page stays original) - Remove inertia-test2 test route
This commit is contained in:
Executable
+12
@@ -0,0 +1,12 @@
|
||||
import { createInertiaApp } from '@inertiajs/react'
|
||||
import { createRoot } from 'react-dom/client'
|
||||
|
||||
createInertiaApp({
|
||||
resolve: name => {
|
||||
const pages = import.meta.glob('./pages/**/*.jsx', { eager: true })
|
||||
return pages[`./pages/${name}.jsx`]
|
||||
},
|
||||
setup({ el, App, props }) {
|
||||
createRoot(el).render(<App {...props} />)
|
||||
},
|
||||
})
|
||||
Reference in New Issue
Block a user