Start sharing components as a team!Share components as a team!Join Bit to build your applications faster.Get Started Free

react-native

v1.0.21arrow_drop_down
v1.0.21
v1.0.20
v1.0.19
v1.0.18
v1.0.17
v1.0.16
v1.0.15
v1.0.14
v1.0.13
v1.0.12
v1.0.11
v1.0.10
v1.0.9
v1.0.8
v1.0.7
v1.0.6
v1.0.5
v1.0.4
v1.0.3
v1.0.2
v1.0.1
v1.0.0
v0.0.7
v0.0.6
v0.0.5
v0.0.4
v0.0.3
v0.0.2
v0.0.1
STATUS
Passing
DOWNLOADS
2,798
LICENSE
MIT
VISIBILITY
Public
PUBLISHED
3 months ago
SIZE
393 KB
Bit React Native compiler. Compiles ReactNative components with Bit.
3 contributors
Install react-native as a package?
Copied
npm i @bit/bit.envs.compilers.react-native
Set Bit as a scoped registryLearn more
npm config set '@bit:registry' https://node.bit.dev
Component Example
React
React
Vue
Angular
React Native
Add dependency... help_outline
Just
import
any of the 1 million components
and packages in Bit or NPM to the example.
import Button from '@bit/grommet.grommet.button';
import Lodash from 'lodash';
toggle layout
modifieddraft
chevron_left
chevron_right

React-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 and jsx 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 also .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

If you get this error, you need to expend the metro-config blacklist to ignore also the components default directory folder where Bit import components. 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).*/]),
  },
};

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.