toma77
V2EX  ›  React

关于 react-router4 的 BrowserRouter 的问题?

  •  
  •   toma77 · Apr 15, 2019 · 2229 views
    This topic created in 2698 days ago, the information mentioned may be changed or developed.

    我使用 create-react-app 脚手架创建项目 我看文档说明 BrowserRouter 使用 h5 的 historyAPI,如果在 localhost:8080/test 这个 url 下刷新,会返回 404,因为会向这个地址发起请求。

    问题是,为什么我本地在这个 url 下刷新不会 404 呢?理论上应该是 404 的啊

    我使用 yarn buld 打包上传到 githug pages 上后,在 localhost:8080/test 下刷新会 404,这是为什么呢?难道 create-react-app 对本地做了处理?

    No Comments Yet
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   2825 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 22ms · UTC 15:42 · PVG 23:42 · LAX 08:42 · JFK 11:42
    ♥ Do have faith in what you're doing.