1- import React from 'react' ;
21import classnames from 'classnames' ;
2+ import React from 'react' ;
33import all from 'react-prop-types/lib/all' ;
4+
45import SafeAnchor from './SafeAnchor' ;
6+ import createChainedFunction from './utils/createChainedFunction' ;
57
68export default class MenuItem extends React . Component {
79 constructor ( props ) {
@@ -35,27 +37,25 @@ export default class MenuItem extends React.Component {
3537 ) ;
3638 }
3739
40+ const { className, style, href, onClick, ...props } = this . props ;
41+
3842 const classes = {
3943 disabled : this . props . disabled ,
4044 active : this . props . active
4145 } ;
4246
4347 return (
4448 < li role = "presentation"
45- className = { classnames ( this . props . className , classes ) }
46- style = { this . props . style }
49+ className = { classnames ( className , classes ) }
50+ style = { style }
4751 >
4852 < SafeAnchor
53+ { ...props }
4954 role = "menuitem"
5055 tabIndex = "-1"
51- id = { this . props . id }
52- target = { this . props . target }
53- title = { this . props . title }
54- href = { this . props . href || '' }
55- onKeyDown = { this . props . onKeyDown }
56- onClick = { this . handleClick } >
57- { this . props . children }
58- </ SafeAnchor >
56+ href = { href || '' }
57+ onClick = { createChainedFunction ( onClick , this . handleClick ) }
58+ />
5959 </ li >
6060 ) ;
6161 }
@@ -80,6 +80,7 @@ MenuItem.propTypes = {
8080 href : React . PropTypes . string ,
8181 target : React . PropTypes . string ,
8282 title : React . PropTypes . string ,
83+ onClick : React . PropTypes . func ,
8384 onKeyDown : React . PropTypes . func ,
8485 onSelect : React . PropTypes . func ,
8586 id : React . PropTypes . oneOfType ( [
0 commit comments