score:8

Accepted answer

There are two ways one can approach this

  1. Setting BrowserRouter basename property to the given language

<BrowserRouter basename=`/${getLanguage()}`>
    <Switch>
        <Route path="/" exact component={Home} />
    </Switch>
< /BrowserRouter>

So you can navigate freely with <Link to="/about" />

  1. or use /:lng before any other route

<Switch>
    <Route path="/:lng/" exact component={Home} />
</Switch>


Related Query

More Query from same tag