title: Local json file is not loading using ajax in react js
body: <p>I have the following react component.</p>
  
  <pre><code>import React, { Component } from 'react';
  class GraphView extends Component { 
      constructor(props){
          super(props);       
          this.state = {      
              datajson: ''
          };      
      }   
      componentDidMount() {
          $.ajax({        
              url: 'data.json',
              dataType: 'json',           
              success: function(data) {
                this.setState({datajson: data});
              }.bind(this)
        });
      }
      render() {      
          return(     
              &lt;div&gt;   
                  ...
              &lt;/div&gt;
          );
      }
  }
  
  export default GraphView;
  </code></pre>
  
  <p>when I try to load the local json file "data.json", it is showing a not found error. Do I need to pass any other parameters? My local json file resides in the same folder as that of GraphView.</p>