Skip to content

Commit 7d00db6

Browse files
committed
Commit generated files
1 parent 51da455 commit 7d00db6

File tree

1 file changed

+50
-0
lines changed

1 file changed

+50
-0
lines changed
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
```markdown
2+
---
3+
"title": "Using babel-plugin-react-native-nodeify-hack Package",
4+
"description": "Learn how to use the babel-plugin-react-native-nodeify-hack package to inject Buffer and process into the global namespace in React Native applications.",
5+
"created_at": "2022-01-08",
6+
"published": true
7+
---
8+
9+
# Using babel-plugin-react-native-nodeify-hack Package
10+
11+
If you're working with React Native and need to use node.js libraries that expect `Buffer` and `process` in the global namespace, the `babel-plugin-react-native-nodeify-hack` package can help you inject them.
12+
13+
## Get Started
14+
15+
1. Install the required packages:
16+
```
17+
yarn add buffer process babel-plugin-react-native-nodeify-hack
18+
```
19+
20+
2. Update your `.babelrc` file to include the plugin:
21+
```json
22+
{
23+
"presets": ["react-native"],
24+
"plugins": ["babel-plugin-react-native-nodeify-hack"]
25+
}
26+
```
27+
28+
3. Manually import `buffer` and `process` modules in your entry files:
29+
```javascript
30+
import process from 'process';
31+
import buffer from 'buffer';
32+
```
33+
34+
4. You are now ready to use node.js libraries in your React Native project!
35+
36+
## Troubleshooting
37+
38+
If you encounter issues, try deleting cache files and restarting the React Native Packager:
39+
```
40+
rm -rf $TMPDIR/react-*
41+
react-native start
42+
```
43+
44+
## Contributing
45+
46+
If you encounter bugs or issues, feel free to contribute by sending Pull Requests to the project repository.
47+
48+
Happy coding with node.js libraries in React Native!
49+
```
50+
```

0 commit comments

Comments
 (0)