UNPKG

@lesnoypudge/utils-react

Version:

lesnoypudge's utils-react

24 lines (23 loc) 614 B
import { withDisplayName } from "../withDisplayName/withDisplayName.js"; import { jsx } from "react/jsx-runtime"; const createWithDecorator = (Decorator) => { const NamedDecorator = withDisplayName("Decorator", Decorator); const withDecorator = (Component) => { const Decorated = (props) => { return /* @__PURE__ */ jsx(NamedDecorator, { ...props, children: /* @__PURE__ */ jsx(Component, { ...props }) }); }; return Decorated; }; return { withDecorator }; }; export { createWithDecorator }; //# sourceMappingURL=createWithDecorator.js.map