/**
 * @license MIT
 * author: Cube Dev Team
 * @cube-dev/ui-kit v0.0.0-canary-d4047d7
 * Released under the MIT license.
 */

import { isValidElement } from 'react';
import { isFragment } from 'react-is';
export function wrapNodeIfPlain(children, render) {
    const childrenIsFragment = children && (Array.isArray(children) || isFragment(children));
    if (!children || (!childrenIsFragment && isValidElement(children))) {
        return children;
    }
    return render();
}

        