javascript - Accessing props of React events -


https://facebook.github.io/react/docs/events.html

i'm using onmouseover , onmouseout events.

... mouseover(e) {   this.setstate({hover: true}); }  mouseout(e) {   this.setstate({hover: false}); }  render() { ... <navitem   onmouseover={this.mouseover.bind(this)}   onmouseout={this.mouseout.bind(this)}   eventkey={0} href='#' </navitem>  ... 

how access/set props of 2 events, property screenx

you can access properties of event, in vanilla javascript.

mouseover(e) {   const screenx = e.screenx;   this.setstate({hover: true}); } 

note: if want access event asynchronously, call e.persist() @ beginning of event handler.


Comments

Popular posts from this blog

scala - 'wrong top statement declaration' when using slick in IntelliJ -

c# - DevExpress.Wpf.Grid.InfiniteGridSizeException was unhandled -

PySide and Qt Properties: Connecting signals from Python to QML -