react 接口數據放組件哪個地方
1 回答

白衣染霜花
TA貢獻1796條經驗 獲得超10個贊
你去好好看一下React組件生命周期這一部分。你可以在子組件添加一個componentWillRecieveProps周期,在里面獲取到即將接收的props。如下: componentWillReceiveProps(nextProps) { this.setState({ A: nextProps.A }); }
- 1 回答
- 0 關注
- 795 瀏覽
添加回答
舉報
0/150
提交
取消