UNPKG

@tamagui/react-native-web-lite

Version:
25 lines (24 loc) 851 B
import useAnimatedProps from "./useAnimatedProps"; import useMergeRefs from "../Utilities/useMergeRefs"; import * as React from "react"; import { jsx } from "react/jsx-runtime"; function createAnimatedComponent(Component) { return React.forwardRef((props, forwardedRef) => { const [reducedProps, callbackRef] = useAnimatedProps( props ), ref = useMergeRefs(callbackRef, forwardedRef), { passthroughAnimatedPropExplicitValues, style } = reducedProps, { style: passthroughStyle, ...passthroughProps } = passthroughAnimatedPropExplicitValues ?? {}; return /* @__PURE__ */ jsx( Component, { ...reducedProps, ...passthroughProps, style: [style, passthroughStyle], ref } ); }); } export { createAnimatedComponent as default }; //# sourceMappingURL=createAnimatedComponent.js.map