mirror of
https://github.com/EnixCoda/Gitako.git
synced 2026-03-11 08:54:44 +00:00
15 lines
310 B
JavaScript
15 lines
310 B
JavaScript
import React from 'react'
|
|
import ReactDOM from 'react-dom'
|
|
|
|
class Portal extends React.PureComponent {
|
|
render() {
|
|
const { into, children } = this.props
|
|
if (!(into instanceof window.Element)) return null
|
|
return ReactDOM.createPortal(
|
|
children,
|
|
into,
|
|
)
|
|
}
|
|
}
|
|
|
|
export default Portal
|