title: getting mouse coordinates in React and jQuery
body: <p>I am trying to get the relative coordinates of the mouse in an element in React using jQuery. </p>
  
  <p>My code doesn't seem to be working and there are no console errors. </p>
  
  <p>code: </p>
  
  <p>index.html</p>
  
  <pre><code>&lt;html lang="en"&gt;
    &lt;head&gt;
      &lt;meta charset="utf-8"&gt;
      &lt;meta name="viewport" content="width=device-width, initial-scale=1"&gt;
      &lt;link rel="shortcut icon" href="%PUBLIC_URL%/favicon.ico"&gt;
      &lt;link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous"&gt;
      &lt;link rel="stylesheet" type="text/css" href="stylesheets.css" &gt;
      &lt;script src="https://code.jquery.com/jquery-3.1.0.js"&gt;&lt;/script&gt;
      &lt;script src="ja.js" type="text/javascript"&gt;&lt;/script&gt;
  
      &lt;title&gt;Where's Waldo&lt;/title&gt;
    &lt;/head&gt;
  
      &lt;div id="root"&gt;&lt;/div&gt;
  
    &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>ja.js (jQuery function) </p>
  
  <pre><code>jQuery(function($) {
   var x,y;
   $("#waldo1").mousemove(function(event) {
       var offset = $(this).offset();
       x = event.pageX- offset.left;
       y = event.pageY- offset.top;
       $("#coords").html("(X: "+x+", Y: "+y+")");
   });
  });
  </code></pre>
  
  <p>component </p>
  
  <pre><code>import React, { Component } from 'react'
  import Timer from './timer'
  
  class Level1 extends Component {
  
      render () {
        return (
        &lt;div&gt;
        &lt;div id="gameBoard"&gt;
          &lt;img id="waldo1" src={require('../images/waldo1(1).jpg')} alt="waldo"/&gt;
        &lt;/div&gt;
        &lt;h2 id="coords"&gt;&lt;/h2&gt;
        &lt;Timer start={Date.now()}/&gt;
        &lt;/div&gt;
          ) // return
        } // render
      } //component
  
      export default Level1
  </code></pre>
  
  <p>I hear jQuery doen't play nice with react. Is my syntax correct or is there a better way entirely? </p>
  
  <p>Thank you.</p>