Why is React Webpack production build showing Blank page?

后端 未结 7 1296
北荒
北荒 2020-12-14 02:04

I\'m building a react app, and at the moment webpack-dev-server works just fine( the hello world text shows up ), But webpack -p shows blank pa

相关标签:
7条回答
  • 2020-12-14 02:37

    use

    import { HashRouter } from 'react-router-dom';
    

    instead of

    import { BrowserRouter} from 'react-router-dom';
    

    and don't forget to replace it in your routes code

    <HashRouter>
      ...
    </HashRouter>
    
    0 讨论(0)
提交回复
热议问题