//import
const store = applyMiddleware(ReduxThunk)(createStore)(reducers);
const App = connect(
state => (state),
dispatch => ({
action: bindActionCreators(actions, dispatch)
})
)(Component);
const mountPoint = document.createElement("div");
mountPoint.setAttribute("id", "root");
document.body.appendChild(mountPoint);
render(
<Provider store={store}>
<App />
</Provider>,
mountPoint
);
I know that subcomponents can get store, by setting contextTypes, but there are only dispatch, getState and other methods in store, and there is no action that bindActionCreators has handled.
this causes me to re-initiate an update state request with dispatch in the subcomponent
I guess the reason is that action is on the App component, not on Provider.
so do subcomponents have to set childContextTypes in the App component if they want to get action through context?
I heard that redux encapsulates react"s context. Would it be out of redux to write childContextTypes, in the App component?