orloff
1
Hi all!
export default class Routes extends React.Component {
render() {
return (
<div>
<Route exact path='/' render={()=>(<Redirect to="/catalog" />)} />
<Switch>
<Route exact path='/catalog' component={Catalog}/>
<Route path='/catalog/:cat' component={Cat} />
</Switch>
</div>
)
}
}
If i go to “/catalog”, component renders ok,
if i go to root “/”, url changed to “/catalog” as expected, but nothing renders,
why?
Mighdy
2
Hello, is your Routes component or the Catalog component wrapped in something ?
I once had this problem, and it was coming from the fact that I wrapped a mapStateToProps around my component the wrong way.
orloff
3
If route to “/catalog” works as expected, and component rendered properly, this mean that’s all wrapped properly?
orloff
4
In some miraculous way, after add real data (createContainer) to component, which is wait for subscription data, redirect started working…
