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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user