Is it safe to use ReactDOM.createPortal() with document.body?

后端 未结 2 583
难免孤独
难免孤独 2021-02-13 09:17

I understand that it\'s probably a bad idea to ReactDOM.render() into document.body. But are there any issues with using ReactDOM.createPortal() with document

2条回答
  •  佛祖请我去吃肉
    2021-02-13 09:34

    Our experience so far on Material-UI has been that it's safe: https://github.com/mui-org/material-ui/issues/21626. We haven't seen any limitations reported by one of the 1m+ developers using the library yet.

提交回复
热议问题