Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/skevy/babel-preset-react-native-stage-0
Use stage-0 Babel features with React Native
https://github.com/skevy/babel-preset-react-native-stage-0
Last synced: 26 days ago
JSON representation
Use stage-0 Babel features with React Native
- Host: GitHub
- URL: https://github.com/skevy/babel-preset-react-native-stage-0
- Owner: skevy
- License: mit
- Created: 2016-03-31T17:08:33.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-11-28T17:25:50.000Z (about 7 years ago)
- Last Synced: 2024-11-06T11:52:35.965Z (about 1 month ago)
- Language: JavaScript
- Homepage:
- Size: 2.93 KB
- Stars: 101
- Watchers: 3
- Forks: 6
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-react-native - babel-preset-react-native-stage-0 ★97 - a Babel preset with latest Javascript goodies (Components / Build & Development)
- awesome-react-native - babel-preset-react-native-stage-0 ★97 - a Babel preset with latest Javascript goodies (Components / Build & Development)
- awesome-react-native - babel-preset-react-native-stage-0 ★97 - a Babel preset with latest Javascript goodies (Components / Build & Development)
- awesome-react-native-ui - babel-preset-react-native-stage-0 ★53 - a Babel preset with latest Javascript goodies (Components / Build & Development)
- awesome-react-native - babel-preset-react-native-stage-0 ★97 - a Babel preset with latest Javascript goodies (Components / Build & Development)
README
# babel-preset-react-native-stage-0
Have you encountered weird errors in React Native when trying to use `babel-preset-react-native` and `babel-preset-stage-0` together? Are you generally just confused and frustrating by how hard it is to use the latest and greatest Babel features on RN? This preset is for you!
## Installation
```bash
npm install babel-preset-react-native-stage-0 --save
```## Usage
Just add a `.babelrc` file to your React Native project that looks like this:
```json5
{
"presets": ["react-native-stage-0"]
}
```Do you want/need experimental legacy decorator support (provided by [babel-plugin-transform-decorators-legacy](https://github.com/loganfsmyth/babel-plugin-transform-decorators-legacy))? Use this as your .babelrc instead:
```json5
{
"presets": ["react-native-stage-0/decorator-support"]
}
```## Troubleshooting
**Q**: I added `stage-0` to my "presets" list, and now everything is broken!
**A**: Don't do that! This preset supersedes the need for including the stage-0 preset, and works properly with React Native.
---
**Q**: I changed my .babelrc to the above, but I'm still getting strange Babel errors!
**A**: Have you cleared your packager cache? Run the following:
```bash
watchman watch-del-all
[the command you use to start the packager] --reset-cache
```If things are still broken, open an issue and I'll try to help you. I may say "not a problem with this preset", and make you go open an issue on the react-native repo. Don't be mad at me if I do that!