1
1
mirror of https://github.com/primer/css.git synced 2024-11-24 13:15:00 +03:00

strip trailing slash from router.pathname

This commit is contained in:
Shawn Allen 2018-12-04 13:57:50 -08:00
parent c54c4b691f
commit aff3f32b0c

View File

@ -43,7 +43,8 @@ export default class MyApp extends App {
}
render() {
const {pathname} = this.props.router
// strip the trailing slash
const pathname = this.props.router.pathname.replace(/\/$/, '')
const filename = pathMap[pathname]
const {Component, page} = this.props
const hasHero = ['/css', '/css/'].includes(pathname)