0

I'm making a website with laravel backend and react as a front-end library and using React-Router & I've this code

<Switch>
          <Route exact path="/" component={ProductsPage}/>
          <Route path="/category/:id" component={CategoryPage}/>
</Switch>

which I also tried switching to

<Switch>
          <Route exact path="/" component={ProductsPage}/>
          <Route path="/category">
              <Route path="/:id" component={CategoryPage} />
          </Route>

here's my web.php page

use Illuminate\Support\Facades\Route;
Route::view('/{path?}', 'app');

Everything works normally except nested routes if I visit /category/805 it gives me a 404

0 Answers0