Home > Software design >  React Router v6 - How to use @ symbol in route?
React Router v6 - How to use @ symbol in route?

Time:04-07

I'm using react-router-dom to manage my routes:

<Routes>
    <Route path="/" element={<MainLayout />}>
        <Route index element={<Home />} />
        <Route path="@:profileId" element={<Profile />} />
    </Route>
<Routes>

I want to use @ prefix at profile route but error is no routes matched location "/@username"

How to fix it?

CodePudding user response:

It seems there's a Edit react-router-v6-how-to-use-symbol-in-route

  • Related