one
Version:
One is a React framework for web, iOS, and Android apps.
27 lines (24 loc) • 663 B
JavaScript
import React from "react";
var Decorated = /* @__PURE__ */ Symbol();
var withStaticProperties = function withStaticProperties2(component, staticProps) {
var next = (function() {
if (component[Decorated]) {
var _ = React.forwardRef(function(props, ref) {
return React.createElement(component, {
...props,
ref
});
});
for (var key in component) {
var v = component[key];
_[key] = v && typeof v === "object" ? { ...v } : v;
}
}
return component;
})();
Object.assign(next, staticProps);
next[Decorated] = true;
return next;
};
export { withStaticProperties };
//# sourceMappingURL=withStaticProperties.native.js.map