Skip to content
This repository was archived by the owner on Apr 9, 2019. It is now read-only.

Commit ffecfe1

Browse files
committed
Update example for React 0.14
1 parent 5998b06 commit ffecfe1

File tree

5 files changed

+10
-8
lines changed

5 files changed

+10
-8
lines changed

examples/index.dev.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77
<link type="text/css" rel="stylesheet" href="assets/example.css" />
88
</head>
99
<body>
10+
<div id="app"></div>
1011
<script src="//localhost:3000/webpack-dev-server.js"></script>
1112
<script src="assets/example.js"></script>
1213
</body>
13-
</html>
14+
</html>

examples/index.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
<link type="text/css" rel="stylesheet" href="assets/example.css" />
88
</head>
99
<body>
10+
<div id="app"></div>
1011
<script src="assets/example.js"></script>
1112
</body>
12-
</html>
13+
</html>

examples/src/example.jsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
const React = require('react');
2+
const ReactDOM = require('react-dom');
23

34
const NavigationController = require('../../src/navigation-controller');
45
const View =require('./view');
@@ -29,4 +30,4 @@ class App extends React.Component {
2930
}
3031
}
3132

32-
React.render(<App />, document.body);
33+
ReactDOM.render(<App />, document.getElementById('app'));

examples/src/view.jsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ const {
77

88
const colors = [
99
'#0074D9', '#7FDBFF', '#39CCCC', '#2ECC40', '#FFDC00', '#FF851B', '#FF4136',
10-
'#F012BE', '#B10DC9'
10+
'#F012BE', '#B10DC9'
1111
];
1212

1313
function getColor() {
@@ -33,9 +33,7 @@ class View extends React.Component {
3333
}
3434
onNext() {
3535
const view = <View index={this.props.index+1} />;
36-
this.props.navigationController.pushView(view, {
37-
38-
});
36+
this.props.navigationController.pushView(view, {});
3937
}
4038
onBack() {
4139
this.props.navigationController.popView({

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@
4141
"minimist": "^1.2.0",
4242
"mocha": "^2.3.4",
4343
"phantomjs": "^1.9.19",
44-
"react": "0.14.6",
44+
"react": "^0.14.6",
45+
"react-dom": "^0.14.6",
4546
"sinon": "^1.17.2",
4647
"webpack": "^1.12.11",
4748
"webpack-dev-server": "^1.14.1"

0 commit comments

Comments
 (0)