📜  setstate 不立即更新状态 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:03:53.684000             🧑  作者: Mango

代码示例3
//if some of your code depends on that state update you can use a useeffect like this
 useEffect(() => {
        if (currentProgress[index].progress === 100) {
            GoBack()
        }
    }, [currentProgress])