dispatch action when component unmounting using useEffect

后端 未结 0 1747
生来不讨喜
生来不讨喜 2021-01-15 08:07

My code is like this:

const dispatch = useDispatch();     
useEffect(() => {
   return () => { dispatch(some_action); }
}, [])

However,

相关标签:
回答
  • 消灭零回复
提交回复
热议问题