Snippets Collections
const rootDomElement: any = document.getElementById('root');
const newBlock = (
      <div>
        <p>The New Content</>
      </div>
  );
ReactDOM.createPortal(newBlock, rootDomElement);


// you can return it too
// return ReactDOM.createPortal(PDFPopup, RootDomElement);
star

Tue May 25 2021 08:03:23 GMT+0000 (UTC)

#react #portal #reactportal

Save snippets that work with our extensions

Available in the Chrome Web Store Get Firefox Add-on Get VS Code extension