为什么swiss undefined在 this中引用setInterval?
在每次迭代中,swiss都会传入 的值。
export default function cheese() {
const swiss = useRef("Jarlsberg")
const myInterval = useRef()
myInterval.current = setInterval ( swiss => {
console.log(swiss) //-> undefined
console.log(swiss.current) //-> Error b/c undefined has no properties
}, 997)
}