We prefer to use Modal components wrapped in a component which use ReactDOM.portal (comes with 16v) for better UI mechanism. Modals and popups are looks familiar but functionality. For example; you have a form in popup, and you have to show a modal if itβs successfully posted or failed badly. Modals needs to be above popup. Weβve created 2 roots like app-root; popup-root and modal-root in a large-scaled application. By this way render methods stay clean and UI flows properly without trading CSS hacks, thanks to DOM order.
Hi, nice article.
We prefer to use Modal components wrapped in a component which use ReactDOM.portal (comes with 16v) for better UI mechanism. Modals and popups are looks familiar but functionality. For example; you have a form in popup, and you have to show a modal if itβs successfully posted or failed badly. Modals needs to be above popup. Weβve created 2 roots like app-root; popup-root and modal-root in a large-scaled application. By this way render methods stay clean and UI flows properly without trading CSS hacks, thanks to DOM order.
Thank you for this article (:
Thanks for the comment, this is the first time I am hearing about ReactDOM.portal, I will go and check it out π.
(Y) basically it allows you to use components outside of your app-root.
See you (: