component-portal
v1.0.1
Published
component for rendering the spec dom
Downloads
1
Readme
📦 Installation
npm install component-portal
🔨 Usage
class Test extends React.PureComponent {
state = {
};
ref=React.createRef<HTMLDivElement>()
render() {
const {} = this.state;
return (
<div>
<Portal getContainer={()=>this.ref.current}>123</Portal>
<div ref={this.ref}>456</div>
<div id='container'>789</div>
<Portal getContainer={'#container'}>123</Portal>
</div>
);
}
}