title: React v16- d3 v4, when using mouse from d3-selection will get, TypeError: Cannot read property 'sourceEvent' of null?
body: <p>Using <strong>d3</strong> with <strong>React</strong> and importing mouse from d3-selection</p>
  
  <pre><code>import { selectAll, select, mouse } from 'd3-selection';
  </code></pre>
  
  <p>when trying use : <code>mouse(e.target) or mouse(select('.element'))</code> in the component, I get this error:</p>
  
  <pre class="lang-none prettyprint-override"><code>TypeError: Cannot read property 'sourceEvent' of null
  ./node_modules/d3-selection/src/sourceEvent.js.__webpack_exports__.a
  node_modules/d3-selection/src/sourceEvent.js:5
    2 | 
    3 | export default function() {
    4 |   var current = event, source;
  &gt; 5 |   while (source = current.sourceEvent) current = source;
    6 |   return current;
    7 | }
    8 | 
  </code></pre>
  
  <p>The project created using <strong>react-create-app</strong>, seems source event is not accessed?...</p>