()
| 12 | const currentIndexRef = useRef(0); // 不能用useState 会导致数据更新不及时 |
| 13 | |
| 14 | const handleLeft = () => { |
| 15 | if (currentIndexRef.current > 0) { |
| 16 | currentIndexRef.current -= 1 |
| 17 | setNowPosition(currentIndexRef.current * 148) |
| 18 | } |
| 19 | } |
| 20 | const handleRight = () => { |
| 21 | if (currentIndexRef.current < files.length - 2) { |
| 22 | currentIndexRef.current += 1 |
nothing calls this directly
no outgoing calls
no test coverage detected