I want the function that fetches data to return a certain value

I am trying to return the data fetched by the function getData() and use the returned value to render the StreamerContainerResult component.

However, it keeps returning “undefined” and as a result, I cant render anything..

I am stuck on this bug for the past few hours and I cant figure it out on my own.. Any help would be highly appreciated. Thank you.

 getData(value, type) {
    let streamerData = [];

    let urls = ['https://wind-bow.gomix.me/twitch-api/streams/' + value, 'https://wind-bow.gomix.me/twitch-api/users/' + value];

    const getJson = url => fetch(url).then(res => res.json());
      .then((values) => {
        if (type === "search") {
            streamer: values
      else {
  return this.getStreamer(values[0],values[1]);
      }).catch(err => {
        console.log('Something went wrong...')


Source: stackoverflow-javascript