📅  最后修改于: 2022-03-11 14:53:04.895000             🧑  作者: Mango
------------------------------------------------------------------------
The useEffect returned function runs according to the dependencies array:
------------------------------------------------------------------------
- if it's empty [], on unmount.
- if it has dependencies [value1,value2], on dependencies
change (shallow comparison) and unmount.
- if it has no dependencies (no 2nd argument for useEffect)
it runs on every render and unmount.
------------------------------------------------------------------------