Skip to content

Commit

Permalink
Add Documentation for React Native (#7419)
Browse files Browse the repository at this point in the history
* Add Documentation for React Native

Closes #7314

* Web3.js Must be Imported as Default Import
  • Loading branch information
danforbes authored Dec 10, 2024
1 parent f41ca32 commit fa5ce5b
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions docs/docs/guides/18_resources_and_troubleshooting/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,30 @@ Additional Info:

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

### TypeError: Cannot read property 'prototype' of undefined, js engine: hermes

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).

**Resolution Steps:**

1. Install `react-native-quick-crypto` as a dependency:

```bash
yarn add react-native-quick-crypto
```

2. Set up `react-native-quick-crypto`:

```bash
cd ios && pod install
```

3. Ensure that Web3.js is imported using the default import, as using a named import does not work:

```bash
import Web3 from 'web3';
```

## Resources

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

1 comment on commit fa5ce5b

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Benchmark

Benchmark suite Current: fa5ce5b Previous: f41ca32 Ratio
processingTx 21928 ops/sec (±6.24%) 20413 ops/sec (±6.44%) 0.93
processingContractDeploy 37222 ops/sec (±9.30%) 36029 ops/sec (±8.88%) 0.97
processingContractMethodSend 14625 ops/sec (±8.78%) 14680 ops/sec (±8.53%) 1.00
processingContractMethodCall 25971 ops/sec (±7.32%) 27056 ops/sec (±6.59%) 1.04
abiEncode 39972 ops/sec (±8.07%) 41028 ops/sec (±7.80%) 1.03
abiDecode 28300 ops/sec (±7.27%) 28296 ops/sec (±7.69%) 1.00
sign 1459 ops/sec (±4.39%) 1470 ops/sec (±4.17%) 1.01
verify 361 ops/sec (±0.60%) 359 ops/sec (±0.70%) 0.99

This comment was automatically generated by workflow using github-action-benchmark.

Please sign in to comment.