redux: fixed estimated

This commit is contained in:
muerwre 2018-11-26 15:20:19 +07:00
parent 185fe80fc5
commit 5d2c534aa9
6 changed files with 30 additions and 38 deletions

View file

@ -91,18 +91,7 @@ export class Component extends React.PureComponent<Props, void> {
}
function mapStateToProps(state) {
const { user: { user } } = state;
const mapStateToProps = ({ user: { user } }) => ({ user });
const mapDispatchToProps = dispatch => bindActionCreators({ setUser, userLogout }, dispatch);
return { user };
}
const mapDispatchToProps = dispatch => bindActionCreators({
setUser,
userLogout,
}, dispatch);
export const UserPanel = connect(
mapStateToProps,
mapDispatchToProps
)(Component);
export const UserPanel = connect(mapStateToProps, mapDispatchToProps)(Component);