import _extends from "@babel/runtime/helpers/esm/extends";
import { __rest } from "tslib";
import * as React from 'react';
/** @private Internal Usage. Only used for Dropdown component. Do not use this in your production. */

var OverrideContext = /*#__PURE__*/React.createContext(null);
/** @private Internal Usage. Only used for Dropdown component. Do not use this in your production. */

export var OverrideProvider = function OverrideProvider(_a) {
  var children = _a.children,
      restProps = __rest(_a, ["children"]);

  var override = React.useContext(OverrideContext);
  var context = React.useMemo(function () {
    return _extends(_extends({}, override), restProps);
  }, [override, restProps.prefixCls, // restProps.expandIcon, Not mark as deps since this is a ReactNode
  restProps.mode, restProps.selectable // restProps.validator, Not mark as deps since this is a function
  ]);
  return /*#__PURE__*/React.createElement(OverrideContext.Provider, {
    value: context
  }, children);
};
export default OverrideContext;