UNPKG

@scrolia/react-native-reanimated

Version:

A set of reanimated components for Scrolia React Native

40 lines (36 loc) 1.06 kB
"use client"; import { useScrollCore } from "@scrolia/react-native/contexts/scrollcore"; import { getComponentProps } from "@scrolia/react-native/functions/props"; import * as React from "react"; import { View } from "react-native"; import Reanimated from "react-native-reanimated"; import { Fragment, jsx } from "react/jsx-runtime"; /** * Vertical track component based on `react-native-reanimated`. * * **This component requires `react-native-reanimated` to be installed.** */ const ReanimatedTrackY = (props) => { const { options: { disabled, animated, plugins }, y: { setHvTrack } } = useScrollCore(); const p = getComponentProps({ name: "trackY", props, plugins }); React.useEffect(() => { setHvTrack(true); }, [setHvTrack]); if (disabled) return /* @__PURE__ */ jsx(Fragment, {}); if (animated) return /* @__PURE__ */ jsx(Reanimated.View, { ...p, ref: p.ref, children: p.children }); return /* @__PURE__ */ jsx(View, { ...p, ref: p.ref, children: p.children }); }; export { ReanimatedTrackY }; //# sourceMappingURL=y.mjs.map