title: async/await and recursion
body: <p>I'm trying to code a method that show recursively an ActionSheetIOS to select a value contained from arrays and return the selected values:</p>
  
  <pre><code>async function _rescursiveSelect(data, index) {
    if (index &lt; data.length) {
      const object = data[index];
  
      if (object.array.length === 1) {
        return await _rescursiveSelect(data, index + 1);
      }
  
      ActionSheetIOS.showActionSheetWithOptions({
        title: 'Choose a value from array: ',
        options: object.array,
      },
      buttonIndex =&gt; async function() {
        const selectedValue = data[index].array[buttonIndex];
        data[index].value = selectedValue;
        delete data[index].array;
  
        return await _rescursiveSelect(data, index + 1);
      });
    } else {
      return data;
    }
  }
  </code></pre>
  
  <p>Unfortunately, when I call this method, it returns <code>undefined</code>. I guess the problem comes from async/await using but I didn't fount it yet.</p>
  
  <p>Any suggestion? </p>