Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Documentation for React Native #7419

Merged
merged 2 commits into from
Dec 10, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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).
Copy link
Contributor

Choose a reason for hiding this comment

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

@danforbes thanks, this is great! maybe also add mention that web3 has to be imported as a default import, as named import doesn't work. I tried to explain it here #7313 (comment)

import Web3 from 'web3';


**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
Loading