UNPKG

@wordpress/components

Version:
30 lines (29 loc) • 792 B
import { forwardRef } from "@wordpress/element"; import { PolymorphicElement } from "../utils/polymorphic-element.mjs"; import { jsx } from "react/jsx-runtime"; // packages/components/src/view/component.tsx function UnforwardedView({ css, ...restProps }, ref) { return /* @__PURE__ */ jsx(PolymorphicElement, { ref, ...restProps }); } /** * `View` is a core component that renders everything in the library. * It is the principle component in the entire library. * * ```jsx * import { View } from `@wordpress/components`; * * function Example() { * return ( * <View> * Code is Poetry * </View> * ); * } * ``` */ const View = Object.assign(forwardRef(UnforwardedView), { selector: ".components-view" }); export { View, View as default }; //# sourceMappingURL=component.mjs.map