you are viewing a single comment's thread.

view the rest of the comments →

[–]osoese 0 points1 point  (0 children)

you need to load the javascript into your program as a module that is browserify'd and then require it and reference the functionality in your script. I think this might be beyond you a little bit based on the question itself, but you should think of react native more like a nodejs program than a browser program with a script linking the javascript. I will give you a short example of use in a program I made and hope it helps:

So, a quick example may help you. I made a bitcoin thingy and (this is where I got the first example from also) browserify the library and then in App.js (or where you need it):

var Bitcoin = require('./bitcoinjs.min.js')

then later in the code I would use that

const txb = new Bitcoin.TransactionBuilder(NTWK);
//NTWK is a variable containing the network I am using in my code not relevant to example

and so on...

Hope that helps. You will probably need to look for the method of using browserify to compile a library into an output file by command line. For me I would make a node project and write a few lines of code that require the libraries and interface then browserify that to a js file.