📜  useEffect 不同的用例 - 无论代码示例

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

代码示例1
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"), [] );