我腦洞大開的加了(),似乎就解決失效的問題,但是會(huì)報(bào)錯(cuò) setTimeout(...) is not a functioncomponentDidMount(){ const props = this.props; this.timer = setTimeout(()=>{ this.props.onRemove(props.item.id) }, 3000)();}
執(zhí)行多個(gè)setTimeout事件,第一個(gè)會(huì)失效
動(dòng)漫人物
2019-03-06 17:51:32