# Life Cycle ###### tags: `待補充` `React` > 以下情境只適用 class component   > 一般而言 Component 有以下三種生命週期的狀態: - `Mounting`:已插入真實的 DOM - `Updating`:正在被重新渲染 - `Unmounting`:已移出真實的 DOM 針對 Component 的生命週期狀態 React 也有提供對應的處理方法: #### Mounting - componentWillMount() - componentDidMount() #### Updating - componentWillReceiveProps(object nextProps):已載入元件收到新的參數時呼叫 - shouldComponentUpdate(object nextProps, object nextState):元件判斷是否重新渲染時呼叫,起始不會呼叫除非呼叫 forceUpdate() - componentWillUpdate(object nextProps, object nextState) - componentDidUpdate(object prevProps, object prevState) #### Unmounting - componentWillUnmount() ## useEffect ###### tags: `useEffect`
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up