Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nitin42/native-base-theme-plugin
A Babel plugin that adds native-base-theme import declaration.
https://github.com/nitin42/native-base-theme-plugin
babel native-base plugin react react-native
Last synced: 27 days ago
JSON representation
A Babel plugin that adds native-base-theme import declaration.
- Host: GitHub
- URL: https://github.com/nitin42/native-base-theme-plugin
- Owner: nitin42
- Created: 2017-02-19T13:54:15.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2017-02-20T12:40:23.000Z (over 7 years ago)
- Last Synced: 2024-10-07T07:34:16.915Z (about 1 month ago)
- Topics: babel, native-base, plugin, react, react-native
- Language: JavaScript
- Homepage:
- Size: 57.6 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# native-base-theme-require
[![Build Status](https://travis-ci.org/nitin42/native-base-theme-plugin.svg?branch=master)](https://travis-ci.org/nitin42/native-base-theme-plugin)![](https://raw.githubusercontent.com/nitin42/native-base-theme-plugin/master/Group.png)
> A Babel plugin for React Native that adds native-base-theme import declaration in your `index.ios.js`.
## Install
```
yarn add babel-plugin-native-base-theme-require --dev
```
**Make sure that you have installed [yarn](https://yarnpkg.com) (or use npm) and you are using [native base](http://nativebase.io/) UI.**## Example
`index.ios.js````javascript
import React, { Component } from 'react';
import {AppRegistry, Text} from 'react-native';
import { Container, StyleProvider } from 'native-base';
export default class App extends Component {
render() {
return (
Hello World
);
}
}AppRegistry.registerComponent('App', () => learnNative);
```This will transpiled to,
```javascript
import React, { Component } from 'react';
import {AppRegistry, Text} from 'react-native';
import { Container, StyleProvider } from 'native-base';
import getTheme from './native-base-theme/components/index';export default class App extends Component {
render() {
return (
Hello World
);
}
}AppRegistry.registerComponent('App', () => learnNative);
```## Usage
Add `native-base-theme-require` to your `.babelrc`
```.babelrc
{
"plugins": ["native-base-theme-require"]
}
```## Contributing
* Add unit tests for any new or changed functionality
* Fix bugs or issues## License
MIT