@tamagui/react-native-web-lite
Version:
React Native for Web
21 lines (20 loc) • 983 B
JavaScript
import * as React from "react";
import { useMergeRefs } from "@tamagui/react-native-web-internals";
import useAnimatedProps from "./useAnimatedProps";
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.js.map