Proper way of handling conditional component render depending on route?
问题 I searched a lot on the Web and SO, asked in reactiflux chat, but didn't found a clean and non-hack-looking way of rendering some component depending of route/path. Let's say I have the <Header /> which should be shown on some pages and should be hidden on other ones. For sure I can use this string in Header component if (props.location.pathname.indexOf('/pageWithoutAHeader') > -1) return null That's totally fine, if /pageWithoutAHeader is the unique. If I need same functionality for 5 pages