In my Component definition in React, I am appending an eventListener like this:
/* events.js */
export function mouseyDown( event ) {
console.log( event.target );
}
/* main.js */
import mouseyDown from '../controllers/events.js';
const Topbar = React.createClass ({
callMouseyDown : function( event ) {
console.log( event.target );
mouseyDown(); // actually need to pass event to this method too
},
render : function() {
return (
<div className="tbIcon" data-action="shareSocial" onClick={ this.callMouseyDown}>G</div>
)}
});
However, React is giving me this error:
_EventController2.default is not a function
What am I doing wrong?