Skip to content
New issue

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

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

Already on GitHub? # to your account

Add Typescript types and documentation for Promise Rejection #801

Open
mjaggard opened this issue Jul 15, 2024 · 0 comments
Open

Add Typescript types and documentation for Promise Rejection #801

mjaggard opened this issue Jul 15, 2024 · 0 comments

Comments

@mjaggard
Copy link

Introduction

When developing a React Native app which uses NativeModules I found myself wanting to handle errors but struggling to even know what types should be returned for rejection of promises.

Discussion points

  1. I think documentation needs improvement for promise rejection, unless I missed something I couldn't find any info on that.
  2. There should be some types provided for those using Typescript to deal with the result of a rejection.
    The type should have these properties for Android:
    https://github.com/facebook/react-native/blob/1ca63e3e3dff6639f4efde74583145f9fa53759a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridge/PromiseImpl.java#L31
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant