react-router 4 - Browser history needs a DOM

前端 未结 3 913
清酒与你
清酒与你 2020-12-05 06:47

I am trying server side rendering using react-router 4. I am following the example provided here https://reacttraining.com/react-router/web/guides/server-rendering/putting-i

3条回答
  •  长情又很酷
    2020-12-05 07:24

    In clientIndex.js

    Rather than BrowserRouter use StaticRouter.

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

    import { StaticRouter } from 'react-router-dom'

提交回复
热议问题