title: How to get local JSON (fetch)?
body: <p>How to get local JSON (fetch)?</p>
  
  <p>I do a service, then I call the class instance</p>
  
  <p>This is not how it works:</p>
  
  <p>Services.js</p>
  
  <pre><code>export default class ApiService {
      async GetPeople() {
          const request = await fetch('./data.json');
          if(!request.ok) {
              throw new Error('Что-то пошло не так', request.status)
          } else {
              return request.json()
          };
      };
  };
  </code></pre>
  
  <p>Userslist.js</p>
  
  <pre><code>import Service from '../../../Services';
  
  const UsersListContainer = () =&gt; {
  
      const api = new Service();
  
      useEffect(() =&gt; {
          api.GetPeople()
          .then(data =&gt; console.log(data))
      }, [api])
  
      return (
          &lt;UsersListView /&gt;
      );
  };
  
  export default UsersListContainer;
  </code></pre>