Skip to content

Commit a0b0835

Browse files
committed
updated/renamed data-flow example
1 parent 3926a5e commit a0b0835

File tree

4 files changed

+12
-13
lines changed

4 files changed

+12
-13
lines changed

examples/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ <h1>React Router Examples</h1>
77
<li><a href="animations/index.html">Animations</a></li>
88
<li><a href="async-data/index.html">Async Data</a></li>
99
<li><a href="auth-flow/index.html">Auth Flow</a></li>
10-
<li><a href="data-flow/index.html">Data Flow</a></li>
10+
<li><a href="passing-props-to-children/index.html">Passing Props to Children</a></li>
1111
<li><a href="dynamic-segments/index.html">Dynamic Segments</a></li>
1212
<li><a href="master-detail/index.html">Master Detail</a></li>
1313
<li><a href="huge-apps/index.html">Huge Apps (Partial App Loading)</a></li>
File renamed without changes.
Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
var React = require('react');
2-
var { Route, createRouter, Link, Navigation } = require('react-router');
3-
var HashHistory = require('react-router/HashHistory');
2+
var { Router, Route, Link, Navigation, HashHistory } = require('react-router');
43

54
var App = React.createClass({
65

@@ -35,7 +34,7 @@ var App = React.createClass({
3534
var links = this.state.tacos.map(function (taco, i) {
3635
return (
3736
<li key={i}>
38-
<Link to="taco" params={taco}>{taco.name}</Link>
37+
<Link to={`/taco/${taco.name}`}>{taco.name}</Link>
3938
</li>
4039
);
4140
});
@@ -71,10 +70,10 @@ var Taco = React.createClass({
7170
}
7271
});
7372

74-
var Router = createRouter(
75-
<Route component={App}>
76-
<Route name="taco" path="taco/:name" component={Taco}/>
77-
</Route>
78-
);
79-
80-
React.render(<Router history={HashHistory}/>, document.getElementById('example'));
73+
React.render((
74+
<Router history={HashHistory}>
75+
<Route path="/" component={App}>
76+
<Route path="taco/:name" component={Taco}/>
77+
</Route>
78+
</Router>
79+
), document.getElementById('example'));

examples/data-flow/index.html renamed to examples/passing-props-to-children/index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
<link href="../global.css" rel="stylesheet"/>
44
<link href="app.css" rel="stylesheet"/>
55
<body>
6-
<h1 class="breadcrumbs"><a href="../index.html">React Router Examples</a> / Data Flow</h1>
6+
<h1 class="breadcrumbs"><a href="../index.html">React Router Examples</a> / Passing Props to Children</h1>
77
<div id="example"/>
88
<script src="/__build__/shared.js"></script>
9-
<script src="/__build__/data-flow.js"></script>
9+
<script src="/__build__/passing-props-to-children.js"></script>
1010

0 commit comments

Comments
 (0)