Portals

When a React component returns content, it gets rendered into its parent component. Then, that parent's content gets rendered into its parent component and so on, all the way to the tree root. There are times when you want to render something that specifically targets a DOM element. For example, a component that should be rendered as a dialog probably doesn't need to be mounted at the parent. Using a portal, you can control specifically where your component's content is rendered.

You can read more about portals here: https://reactjs.org/docs/portals.html.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.222.239.77