UNPKG

@scrolia/react-native

Version:
34 lines (31 loc) 865 B
"use client"; import { useScrollCore } from "../../contexts/scrollcore.mjs"; import { getComponentProps } from "../../functions/props.mjs"; import { Animated, View } from "react-native"; import * as React from "react"; import { Fragment, jsx } from "react/jsx-runtime"; /** Vertical track component. */ const TrackY = (props) => { const { options: { disabled, animated, plugins }, x: { 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(Animated.View, { ...p, ref: p.ref, children: p.children }); return /* @__PURE__ */ jsx(View, { ...p, ref: p.ref, children: p.children }); }; export { TrackY }; //# sourceMappingURL=y.mjs.map