React-Bootstrap中的NavDropdown中的EventKeys

Moe*_*ler 5 reactjs react-bootstrap

我在NavDropdowns中遇到了eventKey问题.

var Navigation = React.createClass({

  handleSelect: function(eventKey){
    console.log(eventKey);
  },

  render: function() {
    return (
      <Navbar brand='Navbar' toggleNavKey={0}>
        <CollapsibleNav eventKey={0} onSelect={this.handleSelect}>

          <Nav navbar>
            <NavItem eventKey={1}>Home</NavItem>
          </Nav> 


          <Nav navbar right hide>
            <NavItem eventKey={2}>Login</NavItem>

            <NavDropdown eventKey={3} title='NavDropdown' id='basic-nav-dropdown'>
              <MenuItem eventKey={4}>Action 1</MenuItem>
              <MenuItem eventKey={5}>Action 2</MenuItem>
            </NavDropdown>
          </Nav>

        </CollapsibleNav>
      </Navbar>

    )
  }
});
Run Code Online (Sandbox Code Playgroud)

我希望能够在我的selectHandler中告诉我点击了什么Nav元素.这适用于除NavDropdown之外的所有元素:

单击Dropdown不会触发selectHandler,这很好.但是,当我单击其中一个MenuItem,而不是给我一个eventKey时,它给了我一个事件对象.

如何修改NavDropdown以便它为我提供eventKey?


编辑:我的版本是:

"react": "^0.14.0-beta3",
"react-bootstrap": "^0.25.100-react-pre.0",
Run Code Online (Sandbox Code Playgroud)