a demo integrated u3.js into react native
u3.jsis default to browser and nodejs environments, but you can still integrate u3.js to react native usingrn-nodeify.
-
for a new react native project,
npm install -g react-native-clifirst and thenreact-native init XXX. -
npm install -g rn-nodeify. -
update package.json adding
"postinstall": "rn-nodeify --install --hack",to the scripts. -
cd XXXand thennpm install u3.js asyncstorage-down --saveor if you just need the ecc lib for signing,npm install u3-utils --save -
replace the generated file
shim.jswith the same one in the root of project. -
add
import './shim';to top position of the entry fileindex.js. -
refer to
App.jsand use u3.js in react native.
if you have any problem when integrating u3.js to react native,please contact me.
