Skip to content

Commit 3891ee7

Browse files
committed
No semicolons
1 parent f28e1e5 commit 3891ee7

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+1369
-1369
lines changed

README.md

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -32,25 +32,25 @@ Then with a module bundler or webpack, use as you would anything else:
3232

3333
```js
3434
// using an ES6 transpiler, like babel
35-
import { Router, Route, Link } from 'react-router';
35+
import { Router, Route, Link } from 'react-router'
3636

3737
// not using an ES6 transpiler
38-
var ReactRouter = require('react-router');
39-
var Router = ReactRouter.Router;
40-
var Route = ReactRouter.Route;
41-
var Link = ReactRouter.Link;
38+
var ReactRouter = require('react-router')
39+
var Router = ReactRouter.Router
40+
var Route = ReactRouter.Route
41+
var Link = ReactRouter.Link
4242
```
4343

4444
You can require only the pieces you need straight from the `lib` directory:
4545

4646
```js
47-
import { Router } from 'react-router/lib/Router';
47+
import { Router } from 'react-router/lib/Router'
4848
```
4949

5050
There's also a UMD build in the `umd` directory:
5151

5252
```js
53-
import ReactRouter from 'react-router/umd/ReactRouter';
53+
import ReactRouter from 'react-router/umd/ReactRouter'
5454
```
5555

5656
If you're using globals, you can find the library on `window.ReactRouter`.
@@ -62,10 +62,10 @@ If you just want to drop a `<script>` tag in your page and be done with it, you
6262
### What's it look like?
6363

6464
```js
65-
import { Router, Route } from 'react-router';
65+
import { Router, Route } from 'react-router'
6666

67-
var App = React.createClass({/*...*/});
68-
var About = React.createClass({/*...*/});
67+
var App = React.createClass({/*...*/})
68+
var About = React.createClass({/*...*/})
6969
// etc.
7070

7171
var Users = React.createClass({
@@ -85,16 +85,16 @@ var Users = React.createClass({
8585
{this.props.children}
8686
</div>
8787
</div>
88-
);
88+
)
8989
}
90-
});
90+
})
9191

9292
var User = React.createClass({
9393
componentDidMount() {
9494
this.setState({
9595
// route components are rendered with useful information, like URL params
9696
user: findUserById(this.props.params.userId)
97-
});
97+
})
9898
},
9999

100100
render() {
@@ -103,9 +103,9 @@ var User = React.createClass({
103103
<h2>{this.state.user.name}</h2>
104104
{/* etc. */}
105105
</div>
106-
);
106+
)
107107
}
108-
});
108+
})
109109

110110
// Declarative route configuration (could also load this config lazily
111111
// instead, all you really need is a single root route, you don't need to
@@ -120,7 +120,7 @@ React.render((
120120
<Route path="*" component={NoMatch}/>
121121
</Route>
122122
</Router>
123-
), document.body);
123+
), document.body)
124124
```
125125

126126
See more in the [Introduction](/docs/introduction/README.md) and [Advanced

docs/Glossary.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,4 +234,4 @@ A *router state* represents the current state of a router. It contains:
234234
- the current [`location`](#location),
235235
- an array of [`routes`](#route) that match that location,
236236
- an object of [`params`](#params) that were parsed out of the URL, and
237-
- an array of [`components`](#component) that will be rendered to the page in hierarchical order.
237+
- an array of [`components`](#component) that will be rendered to the page in hierarchical order.

docs/Troubleshooting.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
```js
66
<Route component={App}>
7-
{/* ... other routes */
7+
{/* ... other routes */}
88
</Route>
99

1010
var App = React.createClass({
@@ -13,8 +13,8 @@ var App = React.createClass({
1313
},
1414

1515
componentWillReceiveProps(nextProps) {
16-
var routeChanged = nextProps.location !== this.props.location;
17-
this.setState({ showBackButton: routeChanged });
16+
var routeChanged = nextProps.location !== this.props.location
17+
this.setState({ showBackButton: routeChanged })
1818
}
19-
});
20-
```
19+
})
20+
```

docs/advanced/ConfirmingNavigation.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ React Router provides a [`routerWillLeave` lifecycle hook](/docs/Glossary.md#rou
88
To install this hook, use the `Lifecycle` mixin in one of your [route component](/docs/Glossary.md#routecomponent)s.
99

1010
```js
11-
import { Lifecycle } from 'react-router';
11+
import { Lifecycle } from 'react-router'
1212

1313
var Home = React.createClass({
1414

@@ -18,18 +18,18 @@ var Home = React.createClass({
1818

1919
routerWillLeave(nextLocation) {
2020
if (!this.state.isSaved)
21-
return 'Your work is not saved! Are you sure you want to leave?';
21+
return 'Your work is not saved! Are you sure you want to leave?'
2222
},
2323

2424
// ...
2525

26-
});
26+
})
2727
```
2828

2929
If you need a [`routerWillLeave`](/docs/api/Lifecycle.md#routerwillleavenextlocation) hook in a deeply nested component, simply use the [`RouteContext`](/docs/api/RouteContext.md) mixin in your [route component](/docs/Glossary.md#routecomponent) to put the `route` in context.
3030

3131
```js
32-
import { Lifecycle, RouteContext } from 'react-router';
32+
import { Lifecycle, RouteContext } from 'react-router'
3333

3434
var Home = React.createClass({
3535

@@ -38,10 +38,10 @@ var Home = React.createClass({
3838
mixins: [ RouteContext ],
3939

4040
render() {
41-
return <NestedForm />;
41+
return <NestedForm />
4242
}
4343

44-
});
44+
})
4545

4646
var NestedForm = React.createClass({
4747

@@ -51,10 +51,10 @@ var NestedForm = React.createClass({
5151

5252
routerWillLeave(nextLocation) {
5353
if (!this.state.isSaved)
54-
return 'Your work is not saved! Are you sure you want to leave?';
54+
return 'Your work is not saved! Are you sure you want to leave?'
5555
},
5656

5757
// ...
5858

59-
});
60-
```
59+
})
60+
```

docs/advanced/DynamicRouting.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ var CourseRoute = {
3333
callback(null, require('./components/Course'))
3434
})
3535
}
36-
};
36+
}
3737
```
3838

3939
Now go look at what hacks you have in place to do this. Just kidding, I don't want to make you sad right now.

docs/api/IsActive.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,21 +16,21 @@ Let's say you are using bootstrap and want to get `active` on those `li`
1616
tags for the Tabs:
1717

1818
```js
19-
import { Link, IsActive } from 'react-router';
19+
import { Link, IsActive } from 'react-router'
2020

2121
let Tab = React.createClass({
2222

2323
mixins: [ IsActive ],
2424

2525
render() {
26-
let isActive = this.isActive(this.props.to, this.props.query);
27-
let className = isActive ? 'active' : '';
28-
return <li className={className}><Link {...this.props}/></li>;
26+
let isActive = this.isActive(this.props.to, this.props.query)
27+
let className = isActive ? 'active' : ''
28+
return <li className={className}><Link {...this.props}/></li>
2929
}
3030

31-
});
31+
})
3232

3333
// use it just like <Link/>, and you'll get an anchor wrapped in an `li`
3434
// with an automatic `active` class on both.
3535
<Tab href="foo">Foo</Tab>
36-
```
36+
```

docs/api/Navigation.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ Transitions to a new URL.
1818
##### Examples
1919

2020
```js
21-
router.transitionTo('/users/123');
22-
router.transitionTo('/users/123', {showGrades: true}); // -> /users/123?showGrades=true
23-
router.transitionTo('/pictures/123', null, { fromDashboard: true });
21+
router.transitionTo('/users/123')
22+
router.transitionTo('/users/123', {showGrades: true}) // -> /users/123?showGrades=true
23+
router.transitionTo('/pictures/123', null, { fromDashboard: true })
2424
```
2525

2626
#### `replaceWith(pathname, query, state)`
@@ -37,9 +37,9 @@ the history (like a redirect).
3737
##### Examples
3838

3939
```js
40-
router.replaceWith('/users/123');
41-
router.replaceWith('/users/123', {showGrades: true}); // -> /users/123?showGrades=true
42-
router.replaceWith('/pictures/123', null, { fromDashboard: true });
40+
router.replaceWith('/users/123')
41+
router.replaceWith('/users/123', {showGrades: true}) // -> /users/123?showGrades=true
42+
router.replaceWith('/pictures/123', null, { fromDashboard: true })
4343
```
4444

4545
#### `go(n)`
@@ -66,7 +66,7 @@ front of the `pathname` for `HashHistory`.
6666
### Example
6767

6868
```js
69-
import { Navigation } from 'react-router';
69+
import { Navigation } from 'react-router'
7070

7171
React.createClass({
7272

@@ -82,4 +82,4 @@ React.createClass({
8282
)
8383
}
8484
})
85-
```
85+
```

docs/api/PlainRoute.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,16 +31,16 @@ let myRoute = {
3131
gradesRoute,
3232
assignmentsRoute
3333
]
34-
};
34+
}
3535

3636
// async child routes
3737
let myRoute = {
3838
path: 'course/:courseId',
3939
getChildRoutes (location, cb) {
4040
// do asynchronous stuff to find the child routes
41-
cb(null, [announcementsRoute, gradesRoute, assignmentsRoute]);
41+
cb(null, [announcementsRoute, gradesRoute, assignmentsRoute])
4242
}
43-
};
43+
}
4444

4545
// navigation dependent child routes
4646
// can link with some state
@@ -55,5 +55,5 @@ let myRoute = {
5555
else
5656
cb(null, [pictureRoute])
5757
}
58-
};
59-
```
58+
}
59+
```

docs/api/Route.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ var routes = (
2727
<Route path="groups" component={Groups}/>
2828
<Route path="users" component={Users}/>
2929
</Route>
30-
);
30+
)
3131

3232
var App = React.createClass({
3333
render () {
@@ -36,9 +36,9 @@ var App = React.createClass({
3636
{/* this will be either <Users> or <Groups> */}
3737
{this.props.children}
3838
</div>
39-
);
39+
)
4040
}
41-
});
41+
})
4242
```
4343

4444
#### `components`
@@ -62,11 +62,11 @@ var routes = (
6262
<Route path="users/:userId" components={Profile}/>
6363
</Route>
6464
</Route>
65-
);
65+
)
6666

6767
var App = React.createClass({
6868
render () {
69-
var { main, sidebar } = this.props.children;
69+
var { main, sidebar } = this.props.children
7070
return (
7171
<div>
7272
<div className="Main">
@@ -76,9 +76,9 @@ var App = React.createClass({
7676
{sidebar}
7777
</div>
7878
</div>
79-
);
79+
)
8080
}
81-
});
81+
})
8282

8383
var Users = React.createClass({
8484
render () {
@@ -90,9 +90,9 @@ var Users = React.createClass({
9090
to continue with the nesting */}
9191
{this.props.children}
9292
</div>
93-
);
93+
)
9494
}
95-
});
95+
})
9696
```
9797

9898
#### `getComponent(location, callback)`
@@ -109,7 +109,7 @@ code-splitting.
109109
```js
110110
<Route path="courses/:courseId" getComponent={(location, cb) => {
111111
// do asynchronous stuff to find the components
112-
cb(null, Course);
112+
cb(null, Course)
113113
}}/>
114114
```
115115

@@ -127,7 +127,7 @@ code-splitting.
127127
```js
128128
<Route path="courses/:courseId" getComponent={(location, cb) => {
129129
// do asynchronous stuff to find the components
130-
cb(null, {sidebar: CourseSidebar, content: Course});
130+
cb(null, {sidebar: CourseSidebar, content: Course})
131131
}}/>
132132
```
133133

0 commit comments

Comments
 (0)