Rodolphus
Rodolphus

Reputation: 15

react-snap changes the path by adding extra '/'

react-snap changes the path by adding extra '/'. For example, when i try to go to '/en', it redirects to '/en/'. So page shows ErrorScreen (not found). I can not access to my paths ('/en', '/en/about', '/de', '/de/uberuns'). If i change my all route by adding '/'. For example, from '/en/about' to '/en/about/'. I can access to my page but i want to my path '/en/about' not like that '/en/about/'. I do not want extra '/'.

const App = () => {
  return (
    <Router>
      <Switch>
        <Redirect exact from='/' to='/en' />
        
        <Route exact strict path='/en' component={HomeScreenEn} />
        <Route exact strict path='/en/about' component={AboutScreenEn} />
        <Route exact strict path='/de' component={HomeScreenDe} />
        <Route exact strict path='/de/uberuns' component={AboutScreenDe} />
        
        <Route component={ErrorScreen} />
      </Switch>
    </Router>
  )
}

Upvotes: 1

Views: 421

Answers (0)

Related Questions