如何進行React組件單元測試
2 回答

慕妹3146593
TA貢獻1820條經驗 獲得超9個贊
可以在子組件添加一個componentWillRecieveProps周期,在里面獲取到即將接收的props。如下: componentWillReceiveProps(nextProps) { this.setState({ A: nextProps.A }); }
- 2 回答
- 0 關注
- 671 瀏覽
添加回答
舉報
0/150
提交
取消