Bind Navicon toggleMenu in mapDispatchToProps
This commit is contained in:
parent
cbe3b95d8c
commit
a753efd1dd
@ -3,13 +3,11 @@ import { connect } from 'react-redux';
|
||||
import { toggleMenu } from '../actions/ui';
|
||||
|
||||
class Navicon extends PureComponent {
|
||||
handleClick = () => this.props.dispatch(toggleMenu());
|
||||
|
||||
render() {
|
||||
return (
|
||||
<i className="icon-menu navicon" onClick={this.handleClick} />
|
||||
<i className="icon-menu navicon" onClick={this.props.toggleMenu} />
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default connect()(Navicon);
|
||||
export default connect(null, { toggleMenu })(Navicon);
|
||||
|
Loading…
Reference in New Issue
Block a user