jamesknelson / create-react-blog

Start and deploy your own statically rendered blog with create-react-app
https://create-react-blog.netlify.com/
MIT License
550 stars 69 forks source link

Error with header showing up on second index page. #20

Closed nenadfilipovic closed 5 years ago

nenadfilipovic commented 5 years ago

I have 10 posts in 2 pages and when I switch to second page blog doesn't recognize it is index page and shows pink header just like it show in posts. Problem is in 'src/routes/index.js in regex /^\/page\/\d+\/$/.test(req.path) which is expecting url to end with '/'. When I change to /^\/page\/\d+$/.test(req.path) it works like it should. I will send PR.

jamesknelson commented 5 years ago

Thanks! Just merged the PR.