React-router “Cannot GET /*” except for root url

前端 未结 5 1732
春和景丽
春和景丽 2020-12-09 02:41

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/,

5条回答
  •  难免孤独
    2020-12-09 03:23

    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

提交回复
热议问题