(options: UseStrokeDasharrayProps = {})
| 184 | } |
| 185 | |
| 186 | export function useDashedStroke(options: UseStrokeDasharrayProps = {}) { |
| 187 | const [calcStrokeDasharray, strokes] = useStrokeDasharray(options); |
| 188 | const [strokeDasharray, setStrokeDasharray] = useState([...strokes]); |
| 189 | const handleAnimationEnd = () => setStrokeDasharray([...strokes]); |
| 190 | const getStrokeDasharray = (name: string) => { |
| 191 | return strokeDasharray.find((s) => s?.name === name)?.strokeDasharray; |
| 192 | }; |
| 193 | |
| 194 | return { |
| 195 | calcStrokeDasharray, |
| 196 | getStrokeDasharray, |
| 197 | handleAnimationEnd, |
| 198 | }; |
| 199 | } |
no test coverage detected