getDefaultProps 在組件創(chuàng)建之前,會先調(diào)用 getDefaultProps(),這是全局調(diào)用一次,嚴格地來說,這不是組件的生命周期的一部分。在組件被創(chuàng)建并加載候,首先調(diào)用 getInitialState(),來初始化組件的狀態(tài)。 componentWillMount 然后,準備加載組件,會調(diào)用 componentWillMount(),其原型如下: 1 void componentWillMount() 這個函...
www.dbjr.com.cn/article/1232...htm 2025-5-27