Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: TS make DocumentPickerResponse a single response #451

Merged
merged 1 commit into from
Aug 10, 2021

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
Collaborator

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