📜  更新时的使用效果 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:01:47.480000             🧑  作者: Mango

代码示例1
const isInitialMount = useRef(true);

useEffect(() => {
  if (isInitialMount.current) {
     isInitialMount.current = false;
  } else {
      // Your useEffect code here to be run on update
  }
});