We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hello
I have a weird issue routes Route.get('/test', async ({ inertia }) => { Logger.debug('hit /test') return inertia.render('Test', { someData: 'hello' }, { title: "welcome to test " }) }) app.tsx import { InertiaApp } from '@inertiajs/inertia-react' import React from 'react' import ReactDOM from 'react-dom' import '../css/app.css'
Route.get('/test', async ({ inertia }) => { Logger.debug('hit /test') return inertia.render('Test', { someData: 'hello' }, { title: "welcome to test " }) })
// initial page object with props from server const root = document.getElementById('app')
console.log(root) const page = JSON.parse(root?.dataset.page as string)
// dynamically load specified page component from "resources/js/Pages/." dir async function resolver(pageName) { const module = await import(./Pages/${pageName}) return module.default }
./Pages/${pageName}
function App() { return <InertiaApp initialPage={page} resolveComponent={resolver} initialComponent={''} /> }
ReactDOM.render(, root)
The text was updated successfully, but these errors were encountered:
fixed when I put scripts below @interia
@interia
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <link rel="icon" type="image/png" href="/favicon.ico"> @entryPointStyles('app') <title>{{ title }}</title> </head> <body> @inertia() @entryPointScripts('app') </body> </html>
Sorry, something went wrong.
No branches or pull requests
Hello
I have a weird issue
routes
Route.get('/test', async ({ inertia }) => { Logger.debug('hit /test') return inertia.render('Test', { someData: 'hello' }, { title: "welcome to test " }) })
app.tsx
import { InertiaApp } from '@inertiajs/inertia-react'
import React from 'react'
import ReactDOM from 'react-dom'
import '../css/app.css'
// initial page object with props from server
const root = document.getElementById('app')
console.log(root)
const page = JSON.parse(root?.dataset.page as string)
// dynamically load specified page component from "resources/js/Pages/." dir
async function resolver(pageName) {
const module = await import(
./Pages/${pageName}
)return module.default
}
function App() {
return <InertiaApp initialPage={page} resolveComponent={resolver} initialComponent={''} />
}
ReactDOM.render(, root)
The text was updated successfully, but these errors were encountered: