Skip to content
This repository was archived by the owner on Mar 5, 2025. It is now read-only.

Commit fa5ce5b

Browse files
author
Dan Forbes
authored
Add Documentation for React Native (#7419)
* Add Documentation for React Native Closes #7314 * Web3.js Must be Imported as Default Import
1 parent f41ca32 commit fa5ce5b

File tree

1 file changed

+24
-0
lines changed
  • docs/docs/guides/18_resources_and_troubleshooting

1 file changed

+24
-0
lines changed

docs/docs/guides/18_resources_and_troubleshooting/index.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,30 @@ Additional Info:
4444

4545
[Facebook/React-native Issue #28492](https://github.com/facebook/react-native/issues/28492#issuecomment-824698934)
4646

47+
### TypeError: Cannot read property 'prototype' of undefined, js engine: hermes
48+
49+
This error occurs when trying to use Web3.js with React Native. To solve this error, use [the `react-native-quick-crypto` package](https://www.npmjs.com/package/react-native-quick-crypto).
50+
51+
**Resolution Steps:**
52+
53+
1. Install `react-native-quick-crypto` as a dependency:
54+
55+
```bash
56+
yarn add react-native-quick-crypto
57+
```
58+
59+
2. Set up `react-native-quick-crypto`:
60+
61+
```bash
62+
cd ios && pod install
63+
```
64+
65+
3. Ensure that Web3.js is imported using the default import, as using a named import does not work:
66+
67+
```bash
68+
import Web3 from 'web3';
69+
```
70+
4771
## Resources
4872

4973
### [Web3.js v4 course](https://www.youtube.com/watch?v=3ZO_t-Kyr1g&list=PLPn3rQCo3XrP4LbQcOyyHQR8McV7w3HZT)

0 commit comments

Comments
 (0)