Skip to content

Conversation

@GertjanReynaert
Copy link
Contributor

Summary

When using pickSingle TS incorrectly expects us to array destructure the response, which shouldn't be the case for a single response.

Since everywhere in the codebase DocumentPickerResponse[] is used where it is expected to be an array, the current Array<{...}> notation causes TS to mark this as a nested array, instead of just an array.

In this PR I've removed the Array<> notation, making the pickSingle having a single response, and the pickMultiple still having it's array response.

Test Plan

yarn typescript

What's required for testing (prerequisites)?

What are the steps to reproduce (after prerequisites)?

Compatibility

OS Implemented
iOS
Android

Checklist

  • I have tested this on a device and a simulator
  • I added the documentation in README.md
  • I updated the typed files (TS and Flow)

@vonovak vonovak merged commit 4c98593 into react-native-documents:master Aug 10, 2021
@vonovak
Copy link
Member

vonovak commented Aug 10, 2021

ah, sorry about this; thanks for the PR!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants