| 1 |
import React from "react"; |
| 2 |
import { createPortal } from "react-dom"; |
| 3 |
|
| 4 |
/** |
| 5 |
* Portal component. |
| 6 |
* |
| 7 |
* @param {Object} props component properties |
| 8 |
* @param {React.ElementType} props.children component children |
| 9 |
* @param {Element} props.target portal parent |
| 10 |
* @class |
| 11 |
*/ |
| 12 |
function Portal({ children, target }) { |
| 13 |
return createPortal(children, target); |
| 14 |
} |
| 15 |
|
| 16 |
/** |
| 17 |
* @module Portal |
| 18 |
*/ |
| 19 |
export default Portal; |
| 20 |
|