@hamzaqureshi16 when showing your code, it's better to wrap them in triple backticks (`) for readability.
Here's an example:
```
// your code here
```
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
So, I'm using ineritajs with react to build an application, but now i need props, I'm trying to pass props to my component like this
Route::get('/sendprop',function(){
return Inertia::render('tst',["test"=>'test']);
})->name('sendprop');
and this is my react component
import React from 'react'
import { Link } from 'react-router-dom'
export default function tst({test}) {
return (
<div>
<h1>this is {test}</h1>
<Link to={'/'}>
<button className="btn btn-danger rounded-4">Go Back</button>
</Link>
</div>
)
}
this is my first large project with inertia and i have built a small application for learning but passing props there like this worked, I don't know why it isn't working not but the props I'm passing return undefined in the react component.
So apparently problem was my app.jsx setup, I had excluded <App prop={...props}/>
<BrowserRouter>
<App {...props} />
<Routes>
<Route path="/" element={<OurRegister />} />
<Route path="/login" element={<OurLogin />} />
<Route path='/forgotpassword' element={<ForgotPassword/>}/>
</Routes>
</BrowserRouter>
Please or to participate in this conversation.