Jose-cd / React-google-drive-picker

58 stars 70 forks source link

Making google variable accessible #50

Open ynnelson opened 1 year ago

ynnelson commented 1 year ago

Need to make google accessible in order to call google.picker.Action.PICKED or other variables from my components using the hook.

It makes writing callback function like the one below easier.

callbackFunction: (data) => {
        let url = "";
        if (
          data[google.picker.Response.ACTION] === google.picker.Action.PICKED
        ) {
          let doc = data[google.picker.Response.DOCUMENTS][0];
          url = doc[google.picker.Document.URL];
        }
      }