第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問(wèn)題,去搜搜看,總會(huì)有你想問(wèn)的

componentWillReceiveProps 不能檢測(cè)數(shù)據(jù)的改變

componentWillReceiveProps 不能檢測(cè)數(shù)據(jù)的改變

幕布斯6054654 2019-02-06 21:30:03
**//我通過(guò)websocket發(fā)送了請(qǐng)求,收到了返回的一些數(shù)據(jù),但是現(xiàn)在Thumbnail組件收不到數(shù)據(jù)
查看完整描述

1 回答

?
月關(guān)寶盒

TA貢獻(xiàn)1772條經(jīng)驗(yàn) 獲得超5個(gè)贊

那這說(shuō)明你的connect用的不對(duì),你這個(gè)createSelector不太清楚你這個(gè)是自己封裝的還是第三方插件,單connect這個(gè)插件來(lái)說(shuō),它接受的參數(shù)一共有四個(gè),分別是 mapStateToProps , mapDispatchToProps, mergeProps 和 options。其中一般用到前兩個(gè)差不多了。


mapStateToProps

將 store 中的數(shù)據(jù)作為 props 綁定到組件上。


const mapStateToProps = (state) => {

  return {

    count: state.count

  }

}

mapDispatchToProps

將 action 作為props 綁定到組件上


const mapDispatchToProps = (dispatch, ownProps) => {

  return {

    increase: (...args) => dispatch(actions.increase(...args)),

    decrease: (...args) => dispatch(actions.decrease(...args))

  }

}

你對(duì)一下看你是不是傳的有問(wèn)題


查看完整回答
反對(duì) 回復(fù) 2019-02-13
  • 1 回答
  • 0 關(guān)注
  • 378 瀏覽
慕課專欄
更多

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購(gòu)課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)