I have a multilanguage site that uses url for determining language.
English: HOST/games/
Spanish: HOST/juegos/
Romanian (default): HOST/
Right now I declare my routes like so:
<Route path="/(:lang/)" component={App}>
<Route path="search/:search" component={Search}/>
<Route path="category/:title/(:page/)" component={Category}/>
<Route path="game/:title" component={Game}/>
<Route path="login" component={Login}/>
<Route path="signup" component={Signup}/>
{ /* es */ }
<Route path="categoria/:title/(:page/)" component={Category}/>
<Route path="juego/:title" component={Game}/>
...
</Route>
This works fines, but it allows for someone to go to HOST/games/categoria/:title and it'll work when it shouldn't.
I envision being able to do the following:
<Route>
<Route lang="en" path="/games/" component={App}>
<Route path="category/:title/(:page/)" component={Category}/>
<Route path="game/:title" component={Game}/>
...
</Route>
<Route lang="es" path="/juegos/" component={App}>
<Route path="categoria/:title/(:page/)" component={Category}/>
<Route path="juego/:title" component={Game}/>
...
</Route>
...
</Route>
Is there any way to pass custom props? or how would I implement this?