Is it ok to use ReactDOMServer.renderToString in the browser in areas where React isn't directly managing the DOM?

前端 未结 3 1537
暖寄归人
暖寄归人 2020-12-25 10:29

I\'m working on an app using Leaflet (via react-leaflet). Leaflet directly manipulates the DOM. The react-leaflet library doesn\'t change that, it just gives you React compo

3条回答
  •  Happy的楠姐
    2020-12-25 10:51

    According to the new documentation: https://reactjs.org/docs/react-dom-server.html

    The following methods can be used in both the server and browser environments:

    • renderToString()
    • renderToStaticMarkup()

提交回复
热议问题