This repo contains a number of helper components and example implementations for creating React Native components with Bit.
This workspace is created using React Native workspace template bit new react-native your-workspace-name
.
- A basic React Native component that render text with a custom font.
Created using React Native component templatebit create react-native text
code, read more. - A React component that is used as a theme component that load the custom font, this component includes two examples of loading, one with Link and the other with ttf file.
- A custom React Native env that use the theme component to wrap the compositions of the components that are using this env.
Created using React Native env templatebit create react-native-env my-react-native
code, read more.
To run this workspace, Bit version 0.0.603 or higher is required.
bit install
bit compile
bit start
Here you can see how environments are applied for the components.
"teambit.workspace/variants": {
"{ui/**}": {
// uses the custom env
"company.scope/envs/my-react-native": {}
// uncomment the line below if you remove the custom env and remove the line above
// "teambit.react/react-native": {}
},
"{theme/**}": {
"teambit.react/react": {}
},
"envs/my-react-native": {
"teambit.harmony/aspect": {}
}
}