- Building a dynamically generated JS API using React Native’s bridge is possible (at least for Android).
- The reflection of the object is returned, together with the objectId reference to the object, so the JS side can eventually call methods on that instance.
- The method reflection is used to refer to a method with a specific name and typed arguments, which are dynamically matched with JS types.
Read the full article, click here.
@Xebia: “New post: Generic JS Android API wrapper for React Native”
During a React Native project for one of our clients we added some custom Android and iOS libraries to our code and wanted to call a few exposed methods. In such a case, React Native requires you to write a wrapper class to call those public APIs. It was a small boilerplate nuisance and these wrappers would be unnecessary if we made a generic method call bridging API. Also, using such an API wrapper you can call any (obscure) available Android API that is not wrapped yet. Let’s see how far we can get!
Generic JS Android API wrapper for React Native | Xebia Blog