I am willing to use React-router for my application, and I am trying the example given in the doc first, which I copied below. Now when I go to localhost:3000/,
localhost:3000/
Simplest option: use hash history instead. The urls stay are not very nice and if you need better SEO, I'd opt for server-side rendering as well.
If you're interested in detail about this, this answer was really helpful for me: React-router urls don't work when refreshing or writting manually