0 votes
in ReactJS by
What are portals in React?

1 Answer

0 votes
by

Portal is a recommended way to render children into a DOM node that exists outside the DOM hierarchy of the parent component.

ReactDOM.createPortal(child, container)

The first argument is any render-able React child, such as an element, string, or fragment. The second argument is a DOM element.

Related questions

0 votes
asked Mar 2, 2022 in GraphQL by rajeshsharma
+1 vote
asked May 29, 2020 by anonymous
0 votes
asked Jan 30, 2021 in ReactJS by rajeshsharma
...