UNPKG

are-message

Version:

This is a React global notification message component. It is a standalone implementation of the are-visual message component.

24 lines (20 loc) 436 B
import { getPrefixCls } from '../config'; var targetDOM; /** * 创建渲染容器 */ export default function createContainer(target) { if (targetDOM) { return targetDOM; } var div = document.createElement('div'); div.className = getPrefixCls(); if (target) { targetDOM = target(); targetDOM.appendChild(div); } else { targetDOM = div; document.body.appendChild(targetDOM); } return targetDOM; }