summaryrefslogtreecommitdiffstats
path: root/node_modules/babel-preset-react/README.md
diff options
context:
space:
mode:
authorGravatar Piotr Russ <mail@pruss.it> 2020-11-16 00:10:28 +0100
committerGravatar Piotr Russ <mail@pruss.it> 2020-11-16 00:10:28 +0100
commite06ec920f7a5d784e674c4c4b4e6d1da3dc7391d (patch)
tree55713f725f77b44ebfec86e4eec3ce33e71458ca /node_modules/babel-preset-react/README.md
downloadwebsite_creator-e06ec920f7a5d784e674c4c4b4e6d1da3dc7391d.tar.gz
website_creator-e06ec920f7a5d784e674c4c4b4e6d1da3dc7391d.tar.bz2
website_creator-e06ec920f7a5d784e674c4c4b4e6d1da3dc7391d.zip
api, login, auth
Diffstat (limited to 'node_modules/babel-preset-react/README.md')
-rw-r--r--node_modules/babel-preset-react/README.md66
1 files changed, 66 insertions, 0 deletions
diff --git a/node_modules/babel-preset-react/README.md b/node_modules/babel-preset-react/README.md
new file mode 100644
index 0000000..591a595
--- /dev/null
+++ b/node_modules/babel-preset-react/README.md
@@ -0,0 +1,66 @@
+# babel-preset-react
+
+> Babel preset for all React plugins.
+
+This preset includes the following plugins/presets:
+
+- [preset-flow](https://babeljs.io/docs/plugins/preset-flow/)
+- [syntax-jsx](https://babeljs.io/docs/plugins/syntax-jsx/)
+- [transform-react-jsx](https://babeljs.io/docs/plugins/transform-react-jsx/)
+- [transform-react-display-name](https://babeljs.io/docs/plugins/transform-react-display-name/)
+
+## Install
+
+> You can also check out the React [Getting Started page](https://facebook.github.io/react/docs/hello-world.html)
+
+> For more info, check out the setup page on the [cli](/docs/setup/) and the [usage](/docs/usage/cli/) docs.
+
+Install the CLI and this preset
+
+```sh
+npm install --save-dev babel-cli babel-preset-react
+```
+
+Make a .babelrc config file with the preset
+
+```sh
+echo '{ "presets": ["react"] }' > .babelrc
+```
+
+Create a file to run on
+
+```sh
+echo '<h1>Hello, world!</h1>' > index.js
+```
+
+View the output
+
+```sh
+./node_modules/.bin/babel index.js
+```
+
+## Usage
+
+### Via `.babelrc` (Recommended)
+
+**.babelrc**
+
+```json
+{
+ "presets": ["react"]
+}
+```
+
+### Via CLI
+
+```sh
+babel script.js --presets react
+```
+
+### Via Node API
+
+```javascript
+require("babel-core").transform("code", {
+ presets: ["react"]
+});
+```