UNPKG

@tamagui/react-native-web-lite

Version:
28 lines (27 loc) 1.04 kB
import * as React from "react"; import { useMergeRefs } from "@tamagui/react-native-web-internals"; import useAnimatedProps from "./useAnimatedProps.mjs"; function createAnimatedComponent(Component) { return /* @__PURE__ */React.forwardRef((props, forwardedRef) => { var _useAnimatedProps = useAnimatedProps(props), reducedProps = _useAnimatedProps[0], callbackRef = _useAnimatedProps[1], ref = useMergeRefs(callbackRef, forwardedRef), passthroughAnimatedPropExplicitValues = reducedProps.passthroughAnimatedPropExplicitValues, style = reducedProps.style, _ref = passthroughAnimatedPropExplicitValues ?? {}; const { passthroughStyle, ...passthroughProps } = _ref; var mergedStyle = [style, passthroughStyle]; return /* @__PURE__ */React.createElement(Component, { ...reducedProps, ...passthroughProps, style: mergedStyle, ref }); }); } export { createAnimatedComponent as default }; //# sourceMappingURL=createAnimatedComponent.mjs.map