Best framework to design cross-plat library : <p>I need to build a library(not an app) which can be used in iOS apps, Android apps, Web pages(and probably Windows apps later). The library exposes a function which accepts a few parameters, like for example, a <code>string topic</code>. The function accesses few device info, if applicable, like the advertising id of the device and queries the back-end service for data. Once the data is ready, the function invokes a callback/sends an Event back to the native application(iOS app/Android app/Web page) indicating that the data is ready along with the data. The data might be an object or a WebView. </p>

<p><code>void getTopVotedArticle(string topic)</code> </p>

<p>Which framework do you recommend? 
Currently, I am considering using React Native. However, the documentation around the communication from native platform to RN components is very poor. Almost all the examples of RN assumes that an app or a part of the app is build using RN. Is it possible to build a library using RN which would satisfy the above requirement? Also, are there any examples of such libraries written using RN. 
Please feel free to recommend any other approach/framework to use.</p>
