UNPKG

@wordpress/compose

Version:
20 lines (19 loc) 577 B
// packages/compose/src/higher-order/if-condition/index.tsx import { createHigherOrderComponent } from "../../utils/create-higher-order-component"; import { jsx } from "react/jsx-runtime"; function ifCondition(predicate) { return createHigherOrderComponent( (WrappedComponent) => (props) => { if (!predicate(props)) { return null; } return /* @__PURE__ */ jsx(WrappedComponent, { ...props }); }, "ifCondition" ); } var if_condition_default = ifCondition; export { if_condition_default as default }; //# sourceMappingURL=index.js.map