Update React transform READMEs from babel.github.io [skip ci] (#4903)

* Update React transform READMEs from babel.github.io [skip ci]

* Drop inline-elements polyfill message (move to website)
This commit is contained in:
Brian Ng
2016-11-28 19:50:17 -06:00
committed by Henry Zhu
parent 51e8fd1868
commit 4a14202e92
7 changed files with 182 additions and 20 deletions

View File

@@ -2,10 +2,30 @@
Turn JSX into React Pre-0.12 function calls
## Example
**In**
```javascript
var profile = <div>
<img src="avatar.png" class="profile" />
<h3>{[user.firstName, user.lastName].join(' ')}</h3>
</div>;
```
**Out**
```javascript
var profile = React.DOM.div(null,
React.DOM.img({ src: "avatar.png", "class": "profile" }),
React.DOM.h3(null, [user.firstName, user.lastName].join(" "))
);
```
## Installation
```sh
$ npm install babel-plugin-transform-react-jsx-compat
npm install babel-plugin-transform-react-jsx-compat
```
## Usage
@@ -23,7 +43,7 @@ $ npm install babel-plugin-transform-react-jsx-compat
### Via CLI
```sh
$ babel --plugins transform-react-jsx-compat script.js
babel --plugins transform-react-jsx-compat script.js
```
### Via Node API