📜  什么是 useEffect - 任何代码示例

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

代码示例1
useEffect is a hook for encapsulating code that has 'side effects,' and is like a combination of componentDidMount , componentDidUpdate , and componentWillUnmount . Previously, functional components didn't have access to the component life cycle, but with useEffect you can tap into it.23.1.2019