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';
|
import { toggleMenu } from '../actions/ui';
|
||||||
|
|
||||||
class Navicon extends PureComponent {
|
class Navicon extends PureComponent {
|
||||||
handleClick = () => this.props.dispatch(toggleMenu());
|
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
return (
|
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…
x
Reference in New Issue
Block a user