phuochau / react-native-thumbnail

Get thumbnail from local media. Currently, it only supports for video.
MIT License
135 stars 104 forks source link

any way to assign the return file path to variable? #38

Open jothikannan opened 5 years ago

jothikannan commented 5 years ago
getThumbnail(filePath){
      let thumbnailURL;
      RNThumbnail.get(filePath).then((response) => response.path)
      .then((responseData) => {
        console.warn(responseData);
        return responseData;
      })
      .catch(error => console.warn(error));

      alert(thumbnailURL);
      //return thumbnailURL;
    }

I am trying to get thumbnail path and storing to a variable to be used, But I am getting undefined

SimonErm commented 5 years ago

try with await/async syntax