@coveord/plasma-mantine
Version:
A Plasma flavoured Mantine theme
29 lines (28 loc) • 1.17 kB
JavaScript
/**
* Allows to override static properties from a component function
*
* @param component The component which holds the static properties
* @param properties The new static properties to assign on the component
* @returns A new component with the specified properties. It doesn't change the original component
* @example const Menu = overrideComponent(MantineMenu, {Item: MyMenuItem}); // Menu.Item will equal MyMenuItem
*/ "use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "overrideComponent", {
enumerable: true,
get: function() {
return overrideComponent;
}
});
var _to_consumable_array = require("@swc/helpers/_/_to_consumable_array");
var overrideComponent = function(component, properties) {
var componentClone = function() {
for(var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++){
args[_key] = arguments[_key];
}
return component.apply(void 0, _to_consumable_array._(args));
};
return Object.assign(componentClone, component, properties);
};
//# sourceMappingURL=overrideComponent.js.map