I try to create a react routing on my laravel application. But that doesn't work. I've followed several tutorials without any success.
First, I've add this route to route.php:
Route::get('/', function () {
return view('index', []); });
Then, in index.blade.php:
<div id="app"></div>
<script src="{{asset('js/app.js')}}" ></script>
Then, in my app.js, I've add the routes:
<BrowserRouter>
<Switch>
<Route path="currency" component={Currency}/>
<Route path="/" component={Index}/>
</Switch> </BrowserRouter>
When I reach http://localhost/project/public, the index component is OK but when I try to join http://localhost/project/currency, that doesn't work. I try to remove the route of index component but it's the same for currency.
Do you have an idea ?
Thank's a lot