UNPKG

one

Version:

One is a new React Framework that makes Vite serve both native and web.

29 lines (28 loc) 864 B
import { jsx as _jsx } from "react/jsx-runtime"; import { Slot as RUISlot } from "@radix-ui/react-slot"; import { forwardRef, useMemo } from "react"; import { StyleSheet } from "react-native"; function ShimSlotForReactNative(Component) { return /* @__PURE__ */forwardRef(function RNSlotHOC(param, ref) { var { style, ...props } = param; if (process.env.NODE_ENV !== "production") { if (Array.isArray(style)) { throw new Error("Slot does not support array styles. Use StyleSheet.flatten() or an object style instead."); } } style = useMemo(function () { return StyleSheet.flatten(style); }, [style]); return /* @__PURE__ */_jsx(Component, { ref, ...props, style }); }); } var Slot = ShimSlotForReactNative(RUISlot); export { Slot }; //# sourceMappingURL=Slot.native.js.map