@tamagui/react-native-web-lite
Version:
React Native for Web
28 lines (27 loc) • 958 B
JavaScript
import { jsx as _jsx } from "react/jsx-runtime";
import useAnimatedProps from "./useAnimatedProps.native.js";
import useMergeRefs from "../Utilities/useMergeRefs.native.js";
import * as React from "react";
function createAnimatedComponent(Component) {
return /* @__PURE__ */React.forwardRef(function (props, forwardedRef) {
var [reducedProps, callbackRef] = useAnimatedProps(props),
ref = useMergeRefs(callbackRef, forwardedRef),
{
passthroughAnimatedPropExplicitValues,
style
} = reducedProps,
{
style: passthroughStyle,
...passthroughProps
} = passthroughAnimatedPropExplicitValues ?? {},
mergedStyle = [style, passthroughStyle];
return /* @__PURE__ */_jsx(Component, {
...reducedProps,
...passthroughProps,
style: mergedStyle,
ref
});
});
}
export { createAnimatedComponent as default };
//# sourceMappingURL=createAnimatedComponent.native.js.map