react-native
v1.0.25arrow_drop_downReact-Native compiler
A React-Native component compiler for Bit.
How to use?
In order to run this extension your must have a bit workspace with at least one component defined, for more information on how to build please read the docs section on the bit website. TL;DR version:
Install the React-Native compiler
bit import bit.envs/compilers/react-native -c
Then build using bit build.
bit build
What’s inside
- Compiles
js
andjsx
files. - In order to see which babel presets and plugins are used, take a look at the config.md file.
Common issues
Metro has encountered an error while trying to resolve module 'react-native’…
If you get this error, you need to expend the metro-config blacklist to ignore .bit
folder.
Link to the issue https://github.com/teambit/envs/issues/143
Edit the metro.config.js
file:
const blacklist = require('metro-config/src/defaults/blacklist');
module.exports = {
...
resolver: {
blacklistRE: blacklist([/.bit\/.*/]),
},
};
Expo “jest-haste-map” error after bit import of a component - naming collision
If you get this error, you need to expend the metro-config blacklist to ignore all the non ‘dist’ files from imported components, and also to ignore the bit folder under .git
.
Link to the issue https://github.com/teambit/envs/issues/149
The default directory is: "componentsDefaultDirectory": "components/{name}"
According to the directory, edit the metro.config.js
file:
const blacklist = require('metro-config/src/defaults/blacklist');
module.exports = {
...
resolver: {
blacklistRE: blacklist([/^[^/]components\/(?!.*dist).*/, /.git\/bit\/.*/]),
},
};
F.A.Q
What are my configuration ?
The default configuration without dev mode or overrides is here.
Got any issues or questions?
Collaboration on this Bit environment happens in this repository. Please open an issue or submit pull request there.