Answer the question
In order to leave comments, you need to log in
How to properly link react and redux?
Hello, here is the issue.
When using redax, I have such a moment. For example, there is a simple reducer:
const initialStateUser = {
user: {}
};
function userReducer(state=initialStateUser, action) {
return state;
}
const rootReducer = combineReducers({
user: userReducer,
...
});
const mapStateToProps = store => {
return {
user: store.user
};
};
this.props.user.user.name
Answer the question
In order to leave comments, you need to log in
const mapStateToProps = store => {
return {
user: store.user.user
};
};
const initialStateUser = {
name: "Вася"
};
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question