title: How to return only 3 elements from arrays of object in React
body: <p>So, I basically use Github User API, fetching 30 of users via Axios, and display it as a list, but I want it to be shown only 3 of them, how can it be done? Should I try to trick on map function or something at fetching section?</p>
  
  <p>Tried to do some tricks on map or filter functions but end up with failure.</p>
  
  <pre><code> state = {
      users: [],
      loading: false,
      alert: null
    };
  
  
  
  searchUser = async text =&gt; {
  this.setState({ loading: true });
  
  const res = await axios.get(
    `https://api.github.com/search/users?q=${text}&amp;client_id=${
      process.env.REACT_APP_GITHUB_CLIENT_ID
    }&amp;client_secret=${process.env.REACT_APP_GITHUB_CLIENT_SECRET}`
  );
  
  this.setState({ users: res.data.items, loading: false });
    };
  </code></pre>
  
  <hr>
  
  <pre><code>{users.map(
  &lt;UserItem key={user.id} user={user} /&gt;
          ))}
  </code></pre>