Skip to content

Document best practices for native side of app to communicate with native module #407

Open

Description

Autolinking will create a ReactPackageProvider for every linked module. However the native side of the app doesn't have a way to access the [native] instance of the native module to negotiate or communicate properties/call APIs.

Workaround: static APIs/properties
It would be good to provide a mechanism to avoid this.

Activity

  1. NickGerleman commented on Mar 13, 2021

    @NickGerleman
    Contributor

    Apart from the PropertyBag which you mentioned, ReactNotificationService can also help address this.

  2. chrisglein commented on Mar 15, 2021

    @chrisglein
    Member

    Do we build a mechanism for this or do we just document best/available practices for how to set up this kind of communication? Are there existing samples we can point to that use ReactNotificationService or the PropertyBag that developers can use as a template? We really don't want people to try to invent their own static pattern and get the instancing wrong, so this is a good candidate for documentation.

  3. changed the title [-]Standard way for native side of app to communicate with native module[/-] [+]Document best practices for native side of app to communicate with native module[/+] on Mar 15, 2021
  4. added
    documentation
    enhancement
    and removed on Mar 15, 2021
  5. asklar commented on Mar 16, 2021

    @asklar
    MemberAuthor

    Related to: #333 and #198

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationenhancementsamples

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions