Answers for "How to render Header on all pages except one"

0

How to render Header on all pages except one

render() {
    return (
        <Router>
            <div>
                <Route path="/" render={ ( props ) => ( props.location.pathname !== "/") && <Header /> }>
                <Route exact path="/" component={HomePage} />
                <Route exact path="/download" component={DownloadPage} />
                <Footer />
            </div>
        </Router>
    );
}
Posted by: Guest on May-21-2021

Code answers related to "How to render Header on all pages except one"

Browse Popular Code Answers by Language