idev0085 / react-boilerplate

0 stars 0 forks source link

What is react portal? #106

Open idev0085 opened 3 years ago

idev0085 commented 3 years ago

When we use a modal inside a particular element (a parent component), the modal's height and width will be inherited from the component in which the modal resides. So there is a possibility that the modal will be cropped and not be shown properly in the application.

child components into a DOM node outside of the parent DOM hierarchy defined by the component tree hierarchy. The Portal's most common use cases are when the child components need to visually break out of the parent container as shown below. Modal dialog boxes Tooltips Hovercards Loaders