這個dispatch屬性是怎么獲得的?
react中const {dispatch} = this.props;
一只名叫tom的貓
2018-11-06 13:14:36
TA貢獻1824條經(jīng)驗 獲得超6個贊
這個和 react
無關(guān)
const {dispatch} = this.props;
這段代碼你可以認(rèn)為是這樣:
const dispatch = this.props.dispatch;
那樣寫是 ES6 的簡寫形式。
舉報