const store = configureStore() ;
ReactDOM.render(
<AppContainer>
<Provider store={ store }>
<FakeComponent />
</Provider>
</AppContainer>
, document.getElementById( rootEle ) ) ;
我想在FakeComponent组件中拿到store,我在FakeComponent中试了下this.props.store
和this.context.store
都是undefined,那redux是如何拿到store的?我的需求是在子组件中拿到store,放全局变量可以,不过不是最佳实践嘛。connect mapStateToProps这些会用,不过我不是需要数据模型,因为要和jquery、angular的第三方通信,所以必须拿到store。
试了下,我在子组件的this._reactInternalInstance._context.store
找到了store,但是不推荐的吧