mirror of
https://github.com/ant-design/ant-design.git
synced 2024-12-10 05:19:14 +08:00
20 lines
319 B
JavaScript
20 lines
319 B
JavaScript
|
import React from 'react';
|
||
|
|
||
|
export default class Portal extends React.Component {
|
||
|
componentDidMount() {
|
||
|
this.createContainer();
|
||
|
}
|
||
|
|
||
|
createContainer() {
|
||
|
this.container = true;
|
||
|
this.forceUpdate();
|
||
|
}
|
||
|
|
||
|
render() {
|
||
|
if (this.container) {
|
||
|
return this.props.children;
|
||
|
}
|
||
|
return null;
|
||
|
}
|
||
|
}
|