简体   繁体   中英

React Native and web3 v1.0.0

I've managed to run React Native and web3@0.19.0 with both rn-nodeify and ReactNativify successfully.

I'm aware that web3 v1.0 does build the modules dynamically, but I'm wondering if anyone has been successful in integrating web3@1.0.0 into React Native?

Any thoughts or suggestions would be highly appreciated.

Cheers!

We were successful in integrating React-Native with web3@1.0.0.beta.34 . We used rn-nodify to complete the task. But web3 works only with a specific version of React-Naive ie "react-native": "0.55.4" . You may have a look at our project's repo .

But you may try to use ethers.js . It has a better documentation and integrates better with react-native.

I have successfully integrated web3@1.3.5 in my react-native @0.64.1 application by configuring shim.js and babel.config.js folders. First create and modify shim.js,babel.config.js folders and then install packages below.

npm i --save react-native-crypto
npm i --save react-native-randombytes
npm i --save-dev tradle/rn-nodeify
./node_modules/.bin/rn-nodeify --hack --install

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM