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