MCPcopy Create free account
hub / github.com/MankaiHuang/screen-visualization / handleLeft

Function handleLeft

src/components/Modal/ChooseTemplate.jsx:14–19  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected