I want to intercept paths, for example, if === /detail let Layout not show. ReactJs
Or who can advise me on how to trap the path?
class App extends Component {
check = () => {
if( ){
}
}
render() {
return (
<Router>
<div className="page-container">
<Header />
<div className="content-wrap">
<Layout />
<Switch>
<Route path="/ProductGrids" component={ProductGrids} />
<Route path="/ProductLists" component={ProductLists} />
<Route exact={true} path="*" component={ProductGrids} />
<Route exact={true} path="/" component={ProductGrids} />
<Route exact={true} path="/Detail" component={check} />
</Switch>
</div>
<Footer />
</div>
</Router>
);
}
}