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

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