How to hide header component conditionally wise see in my codesandbox I do not want schedule tab to display header how this possible
Please guide thanks
How to hide header component conditionally wise see in my codesandbox I do not want schedule tab to display header how this possible
Please guide thanks
You could wrap your app with withRouter and access the current location from the location prop. This enables you to render the header conditionally:
const App = props => (
<div>
{props.location.pathname !== "/schedule" && <Header />}
<Main />
</div>
);
export default withRouter(App);
Here is a codepen.
Hope this helps. Happy coding.