Yes if you want to use route syntax in your react components, you need to use ziggy
https://github.com/tighten/ziggy
I use it myself, in the exact same set up as yours
<td>{event.price/100}</td>
<td>
<InertiaLink href={route('event.show', event.id)}>
View
</InertiaLink>
</td>
So form the above code, I've been trying to use the route function with inertia js which is defined in the backend but what happens is that the component isn't rendered and throws an error saying the route is not defined.
Error:
Uncaught ReferenceError: route is not defined
at app.js:33244
at Array.map (<anonymous>)
at app.js:33240
at renderWithHooks (app.js:18235)
at mountIndeterminateComponent (app.js:21061)
at beginWork (app.js:22299)
at HTMLUnknownElement.callCallback (app.js:7195)
at Object.invokeGuardedCallbackDev (app.js:7244)
at invokeGuardedCallback (app.js:7306)
at beginWork (app.js:27209)
Anyway to fix this?
Yes if you want to use route syntax in your react components, you need to use ziggy
https://github.com/tighten/ziggy
I use it myself, in the exact same set up as yours
Please or to participate in this conversation.