📜  如何使用效果进行卸载 - 无论代码示例

📅  最后修改于: 2022-03-11 14:57:00.595000             🧑  作者: Mango

代码示例2
useEffect( () => console.log("mount"), [] );
useEffect( () => console.log("will update data1"), [ data1 ] );
useEffect( () => console.log("will update any") );
useEffect( () => () => console.log("will update data1 or unmount"), [ data1 ] );
useEffect( () => () => console.log("unmount"), [] );