Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

simcha's avatar

Laravel-react-inertia-vite

Greetings

I created a new project based on this guide https://sebastiandedeyne.com/vite-with-laravel/

Unfortunately there is no detailed explanation in the manual (last part) about inertia with react,

And I can in no way arrange between them, it already seems that everything works but this error returns:

Uncaught (in promise) Error: Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:
1. You might have mismatching versions of React and the renderer (such as React DOM)
2. You might be breaking the Rules of Hooks
3. You might have more than one copy of React in the same app

You can check out the project here: https://github.com/sbc640964/laravel-vite-inertia-react

0 likes
2 replies
adrianmcg85's avatar

Can we user 'react-router-dom' as a page router. I'm getting an error with 'Importing binding name 'Routes' is not found.'. I have tried removing from curry braces and reinstalling without lucky.

Please or to participate in this conversation.