2e9c888dcd
Summary:These updates include important changes to correctness in the linked and underlying packages: * https://github.com/gaearon/babel-plugin-react-transform/releases/tag/v2.0.1 * https://github.com/gaearon/babel-plugin-react-transform/releases/tag/v2.0.2 * https://github.com/gaearon/react-proxy/releases/tag/v1.1.3 * https://github.com/gaearon/react-proxy/releases/tag/v1.1.4 * etc We need to include these if we want to ship hot reloading. Create a new project with those versions of packages. <img width="761" alt="screen shot 2016-03-06 at 18 49 20" src="https://cloud.githubusercontent.com/assets/810438/13556222/2d45ca62-e3cc-11e5-8a3f-a2346efe19dd.png"> Verify hot reloading still works. ![](http://cl.ly/2J150y0Y3E1z/download/Screen%20Recording%202016-03-06%20at%2018.48.gif) martinbigio skevy I wasn’t sure whether to touch the shrinkwrap. Closes https://github.com/facebook/react-native/pull/6325 Reviewed By: yungsters Differential Revision: D3019470 Pulled By: martinbigio fb-gh-sync-id: 99bad390cd898f58aa7f74494066561a81eb40e6 shipit-source-id: 99bad390cd898f58aa7f74494066561a81eb40e6 |
||
---|---|---|
.. | ||
configs | ||
lib | ||
transforms | ||
README.md | ||
index.js | ||
package.json | ||
plugins.js |
README.md
babel-preset-react-native
Babel presets for React Native applications. React Native itself uses this Babel preset by default when transforming your app's source code.
If you wish to use a custom Babel configuration by writing a .babelrc
file in your project's root directory, you must specify all the plugins necessary to transform your code. React Native does not apply its default Babel configuration in this case. So, to make your life easier, you can use this preset to get the default configuration and then specify more plugins that run before it.
Usage
As mentioned above, you only need to use this preset if you are writing a custom .babelrc
file.
Installation
Install babel-preset-react-native
in your app:
npm i babel-preset-react-native --save-dev
Configuring Babel
Then, create a file called .babelrc
in your project's root directory. The existence of this .babelrc
file will tell React Native to use your custom Babel configuration instead of its own. Then load this preset:
{
"presets": ["react-native"]
}
You can further customize your Babel configuration by specifying plugins and other options. See Babel's .babelrc
documentation to learn more.
Help and Support
If you get stuck configuring Babel, please ask a question on Stack Overflow or find a consultant for help. If you discover a bug, please open up an issue.