@coveord/plasma-mantine
Version:
A Plasma flavoured Mantine theme
13 lines (12 loc) • 663 B
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
*/ export const overrideComponent = (component, properties)=>{
const componentClone = (...args)=>component(...args);
return Object.assign(componentClone, component, properties);
};
//# sourceMappingURL=overrideComponent.js.map