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

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

大佬們遇到過這個問題嗎?react-dedux用Provider,組件this.props獲取不到store

大佬們遇到過這個問題嗎?react-dedux用Provider,組件this.props獲取不到store

ibeautiful 2019-07-28 12:25:31
index.js部分constApp=lazy(()=>import('./component/home/App'))constPageA=lazy(()=>import('./component/page-a/Component'));conststore=createStore(Reducers);console.log(store)//路由constRoot=({store})=>();ReactDOM.render(Root(store),document.getElementById('root'));store打印出來是有的在App組件里面只打印this.props只打印出來了history的值
查看完整描述

2 回答

?
一只萌萌小番薯

TA貢獻1795條經(jīng)驗 獲得超7個贊

constRoot=(store)=>(
Loading...
}>
);
                            
查看完整回答
反對 回復(fù) 2019-07-28
?
米琪卡哇伊

TA貢獻1998條經(jīng)驗 獲得超6個贊

組件還需要被connect起來,聲明要獲取store里的哪些字段
import{connect}from'react-redux'
classComponentextendsReact.Component{
render(){
console.log(this.props)
}
}
constmapStateToProps=state=>{
return{哪些你需要的值}
}
constmapDispatchToProps={
...
}
exportdefaultconnect(mapStateToProps,mapDispatchToProps)(Component)
                            
查看完整回答
反對 回復(fù) 2019-07-28
  • 2 回答
  • 0 關(guān)注
  • 290 瀏覽
慕課專欄
更多

添加回答

了解更多

舉報

0/150
提交
取消
微信客服

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

幫助反饋 APP下載

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

公眾號

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