inertiajs / inertia-laravel

The Laravel adapter for Inertia.js.
https://inertiajs.com
MIT License
2.1k stars 235 forks source link

nothing in docs to say @viteReactRefresh and converting app.js to app.jsx #661

Open CushtyDev opened 2 months ago

CushtyDev commented 2 months ago

Hi i just spent 6 hours trying to work out why Inertia was not working, and I luckily found a youtube video that says:

@viteReactRefresh and converting app.js to app.jsx. I checked the docs but there is no mention of it, and a few people commented on the video saying the same thing, is it in the docs somewhere? Thanks

wizzymore commented 1 week ago

The docs are providing a generic example of how to include inertia in your app.

If you use vite with react, you need to follow laravel's official instructions for how to include react in your application with proper HMR: https://laravel.com/docs/11.x/vite#react

The template provided in the docs is to show where to include @inertia and @inertiaHead in your template, not how to include your assets correctly in the page.