you need to split front and back-end.
as I understand, when you go to https://example.com, laravel generate front and react router configured for use history api in browser. and when you click to https://example.com/info, your browser call to react router. but if you refresh page, request go to laravel, not react.
in classic spa case, laravel monitoring only https://example.com/api/* requests, and all other "rewrite" to index (to generate react code).
in best practic, you split front and back, as i say. for example, all https://example.com/* request go to the react, web server configured only for html. laravel configured only for subdomain https://api.example.com/*
Feb 14, 2021
1
Level 1
Laravel Restful API & ReactJs
I'm creating SPA using Reactjs and Laravel and used laravel passport to secure my restful api 's.
The thing is whenever I reload the page it returns a 404 error.
Please or to participate in this conversation.