I have these 2 functions. I tried to pass the event "e" through to the promise, but in the "handleOnClick" function, e is null because it's out of the "this" scope. so I assigned the event to "this.clickEvent" and passed that instead, but now I get this long message about synethetic events and event.persist().
How do I fix this?
handleClick( e ) {
this.clickEvent = e;
somePromise( param1, param2 ).then( result => {
handleOnClick( this.clickEvent, param1, param2 );
});
}
handleOnClick( e, param1, param2 ) {
if ( e.shiftKey ) { // get the below message in console here }
}
Warning: This synthetic event is reused for performance reasons. If you're seeing this, you're accessing the property
shiftKey
on a released/nullified synthetic event. This is set to null. If you must keep the original synthetic event around, use event.persist(). See fb.me/react-event-pooling for more information.