const createNewChildComponent = function (parent, Component) {
  let config = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
  const bvEventRoot = parent.$root ? parent.$root.$options.bvEventRoot || parent.$root : null;
  return new Component({
    ...config,
    parent,
    bvParent: parent,
    bvEventRoot
  });
};

export { createNewChildComponent };
