tajo / react-portal

🎯 React component for transportation of modals, lightboxes, loading bars... to document.body or else.
MIT License
2.14k stars 169 forks source link

can I render two elements in a portal? #214

Closed bury-source closed 6 years ago

bury-source commented 6 years ago

i want to use your plugin to render react component into a ifame, can I pass two elements in one portal?

my code:

{
            this.iframeHead && (
            <Portal node={this.iframeHead}>
              <link rel="stylesheet" href="testa.css?max_age=20000000" />
              <link rel="stylesheet" href="testb.css?max_age=20000000" />'
            </Portal>
            )
        }

now it throw an error, how can I do with this?

tajo commented 6 years ago
<Portal node={this.iframeHead}>
  <React.Fragment>
    <link rel="stylesheet" href="https://imgcache.qq.com/open_proj/proj_qcloud_v2/bee-v2/css/bee.css?max_age=20000000" />
    <link rel="stylesheet" href="http://rocket.oa.com/open_proj/proj_qcloud_v2/mc_2014/mysql/css/firewall.css?max_age=20000000" />
  </React.Fragment>
</Portal>