diff --git a/react/src/components/dashboard/bodyBottom/bodyBottom.js b/react/src/components/dashboard/bodyBottom/bodyBottom.js new file mode 100644 index 0000000..d578035 --- /dev/null +++ b/react/src/components/dashboard/bodyBottom/bodyBottom.js @@ -0,0 +1,33 @@ +import React from 'react'; +import ReactDOM from 'react-dom'; +import PropTypes from 'prop-types'; + +export default class BodyEnd extends React.PureComponent { + + static propTypes = { + children: PropTypes.node, + }; + + componentDidMount() { + this._popup = document.createElement('div'); + document.body.appendChild(this._popup); + this._render(); + } + + componentDidUpdate() { + this._render(); + } + + componentWillUnmount() { + ReactDOM.unmountComponentAtNode(this._popup); + document.body.removeChild(this._popup); + } + + _render() { + ReactDOM.render(this.props.children, this._popup); + } + + render() { + return null; + } +} \ No newline at end of file