Skip to content

Commit 0623030

Browse files
committed
Merge pull request ruanyf#20 from ruanyf/v15.0
feat: upgrade to React v15.0.1
2 parents 97271bd + 16a5e74 commit 0623030

File tree

11 files changed

+23516
-4126
lines changed

11 files changed

+23516
-4126
lines changed

README.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -72,15 +72,15 @@ ReactDOM.render(
7272
);
7373
```
7474

75-
Attention, you have to use `<script type="text/babel">` to indicate JSX codes, and include `browser.min.js`, which is a [browser version](https://babeljs.io/docs/usage/browser/) of Babel and could be get inside a [babel-core](https://www.npmjs.com/package/babel-core) npm release, to actually perform the transformation in the browser.
75+
Attention, you have to use `<script type="text/babel">` to indicate JSX codes, and include `browser.min.js`, which is a [browser version](https://babeljs.io/docs/usage/browser/) of Babel and could be get inside a [babel-core@5](https://www.npmjs.com/package/babel-core) npm release, to actually perform the transformation in the browser.
7676

7777
Before v0.14, React use `JSTransform.js` to translate `<script type="text/jsx">`. It has been deprecated ([more info](https://facebook.github.io/react/blog/2015/06/12/deprecating-jstransform-and-react-tools.html)).
7878

7979
## Demo02: Use JavaScript in JSX
8080

8181
[demo](http://ruanyf.github.io/react-demos/demo02/) / [source](https://github.com/ruanyf/react-demos/blob/master/demo02/index.html)
8282

83-
You could also use JavaScript in JSX. It takes angle brackets (&lt;) as the beginning of HTML syntax, and curly brackets ({) as the beginning of JavaScript syntax.
83+
You could also use JavaScript in JSX. It takes angle brackets (&lt;) as the beginning of HTML syntax, and curly brackets (`{`) as the beginning of JavaScript syntax.
8484

8585
```js
8686
var names = ['Alice', 'Emily', 'Kate'];
@@ -186,7 +186,7 @@ ReactDOM.render(
186186
<span>hello</span>
187187
<span>world</span>
188188
</NotesList>,
189-
document.body
189+
document.getElementById('example')
190190
);
191191
```
192192

@@ -225,7 +225,7 @@ var data = 123;
225225

226226
ReactDOM.render(
227227
<MyTitle title={data} />,
228-
document.body
228+
document.getElementById('example')
229229
);
230230
```
231231

@@ -254,7 +254,7 @@ var MyTitle = React.createClass({
254254

255255
ReactDOM.render(
256256
<MyTitle />,
257-
document.body
257+
document.getElementById('example')
258258
);
259259
```
260260

@@ -346,7 +346,7 @@ var Input = React.createClass({
346346
}
347347
});
348348

349-
ReactDOM.render(<Input/>, document.body);
349+
ReactDOM.render(<Input/>, document.getElementById('example'));
350350
```
351351

352352
More information on [official document](http://facebook.github.io/react/docs/forms.html).
@@ -389,7 +389,7 @@ var Hello = React.createClass({
389389

390390
ReactDOM.render(
391391
<Hello name="world"/>,
392-
document.body
392+
document.getElementById('example')
393393
);
394394
```
395395

@@ -442,7 +442,7 @@ var UserGist = React.createClass({
442442
443443
ReactDOM.render(
444444
<UserGist source="https://api.github.com/users/octocat/gists" />,
445-
document.body
445+
document.getElementById('example')
446446
);
447447
```
448448
@@ -459,7 +459,7 @@ ReactDOM.render(
459459
<RepoList
460460
promise={$.getJSON('https://api.github.com/search/repositories?q=javascript&sort=stars')}
461461
/>,
462-
document.body
462+
document.getElementById('example')
463463
);
464464
```
465465

0 commit comments

Comments
 (0)