Skip to content
This repository has been archived by the owner on Apr 25, 2022. It is now read-only.

vwxyutarooo/react-portal-simpler

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

React Portal Simpler

Just appends React Component to the document.body, Nothing more

Hot to use

$npm install --save react-portal-simpler
import Portal from 'react-portal-simpler';

...

render() {
  return(
    <Portal className="sample">
      <div>
        <p>Child elements such as Overlay or Modal or Whatever you want.</p>
      </div>
    </Portal>
  );
}

Will return this

<body>
  ...
  <div id="react-root"></div>
  ...
  <div class="sample">
    <div>
      <p>Child elements such as Overlay or Modal or Whatever you want.</p>
    </div>
  </div>
</body>

Props

Prop Type Required
children element Yes
classNames string No