"use strict";

require("core-js/modules/es.object.define-property.js");
Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.ShouldRender = void 0;
exports.useShouldRender = useShouldRender;
var _useInitialized = require("./use-initialized");
var ShouldRender = exports.ShouldRender = function ShouldRender(props) {
  var shouldRender = useShouldRender(props.active, props.forceRender, props.destroyOnClose);
  return shouldRender ? props.children : null;
};
function useShouldRender(active, forceRender, destroyOnClose) {
  var initialized = (0, _useInitialized.useInitialized)(active);
  if (forceRender) return true;
  if (active) return true;
  if (!initialized) return false;
  return !destroyOnClose;
}