I am using react-bootstrap and I am implementing a dropdown menu in my react web page. In my dropdown menu, I am calling a handleClick function when button is selected.
<Dropdown.Menu>
<Dropdown.Item name = "baudratestate1200" onSelect={this.handleClick}>1200</Dropdown.Item>
<Dropdown.Item name = "baudratestate2400" onSelect={this.handleClick}>2400</Dropdown.Item>
<Dropdown.Item name = "baudratestate4800" onSelect={this.handleClick}>4800</Dropdown.Item>
<Dropdown.Item name = "baudratestate9600" onSelect={this.handleClick}>9600</Dropdown.Item>
</Dropdown.Menu>
Here is my handleClick function:
handleClick = (eventkey, event) => {
console.log(eventkey)
console.log(event)
}
However, the event.target is null, attached below is the console.log from my client browser:
Class {dispatchConfig: {…}, _targetInst: FiberNode, _dispatchInstances: FiberNode, nativeEvent: MouseEvent, _dispatchListeners: ƒ, …}
nativeEvent: (...)
type: (...)
target: null
I have tried binding and not-binding the function in the constructor but both have produced null values for event.target
this.handleClick = this.handleClick.bind(this);
What am I doing wrong here? Any form of concept clarification would be greatly appreciated!