UNPKG

@crossed/ui

Version:

A universal & performant styling library for React Native, Next.js & React

29 lines (28 loc) 700 B
import { useId, useRef, useState } from "react"; import { useSharedValue } from "react-native-reanimated"; import { useUncontrolled } from "@crossed/core"; const useTabs = (state) => { const [value, setValue] = useUncontrolled(state); const listTabRef = useRef(); const left = useSharedValue(0); const width = useSharedValue(0); const scroll = useSharedValue(0); const widthLayout = useSharedValue(0); const id = useId(); const [shouldShow, setShow] = useState(false); return { listTabRef, value, setValue, indicator: { left, width }, scroll, widthLayout, id, shouldShow, setShow }; }; export { useTabs }; //# sourceMappingURL=useTabs.js.map