Skip to content

Commit 470f408

Browse files
committed
Bunch of style tweaks
1 parent 7b12bf6 commit 470f408

File tree

18 files changed

+63
-64
lines changed

18 files changed

+63
-64
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
2-
"name": "react-router-packages",
32
"private": true,
3+
"name": "react-router-packages",
44
"scripts": {
55
"postinstall": "lerna bootstrap --stream",
66
"start": "cd packages/react-router-website && npm start",

packages/react-router-config/modules/__tests__/integration-test.js

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
1-
import matchRoutes from '../matchRoutes'
2-
import renderRoutes from '../renderRoutes'
3-
import expect from 'expect'
4-
import { renderToString } from 'react-dom/server'
51
import React from 'react'
2+
import ReactDOMServer from 'react-dom/server'
63
import StaticRouter from 'react-router/StaticRouter'
4+
import matchRoutes from '../matchRoutes'
5+
import renderRoutes from '../renderRoutes'
76

87
describe('integration', () => {
98
it('generates the same matches in renderRoutes and matchRoutes', () => {
@@ -41,7 +40,7 @@ describe('integration', () => {
4140

4241
const pathname = '/pepper/jalepeno'
4342
const branch = matchRoutes(routes, pathname)
44-
renderToString(
43+
ReactDOMServer.renderToString(
4544
<StaticRouter location={pathname} context={{}}>
4645
{renderRoutes(routes)}
4746
</StaticRouter>
@@ -89,7 +88,7 @@ describe('integration', () => {
8988

9089
const pathname = '/ghost'
9190
const branch = matchRoutes(routes, pathname)
92-
renderToString(
91+
ReactDOMServer.renderToString(
9392
<StaticRouter location={pathname} context={{}}>
9493
{renderRoutes(routes)}
9594
</StaticRouter>
@@ -127,7 +126,7 @@ describe('integration', () => {
127126

128127
const pathname = '/pepper'
129128
const branch = matchRoutes(routes, pathname)
130-
renderToString(
129+
ReactDOMServer.renderToString(
131130
<StaticRouter location={pathname} context={{}}>
132131
{renderRoutes(routes)}
133132
</StaticRouter>
@@ -168,7 +167,7 @@ describe('integration', () => {
168167

169168
let pathname = '/pepper'
170169
let branch = matchRoutes(routes, pathname)
171-
renderToString(
170+
ReactDOMServer.renderToString(
172171
<StaticRouter location={pathname} context={{}}>
173172
{renderRoutes(routes)}
174173
</StaticRouter>
@@ -178,7 +177,7 @@ describe('integration', () => {
178177

179178
pathname = '/pepper/'
180179
branch = matchRoutes(routes, pathname)
181-
renderToString(
180+
ReactDOMServer.renderToString(
182181
<StaticRouter location={pathname} context={{}}>
183182
{renderRoutes(routes)}
184183
</StaticRouter>
@@ -189,4 +188,3 @@ describe('integration', () => {
189188
expect(branch[0].match).toEqual(rendered[0])
190189
})
191190
})
192-

packages/react-router-config/modules/__tests__/matchRoutes-test.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,4 +95,3 @@ describe('pathless routes', () => {
9595
})
9696
})
9797
})
98-

packages/react-router-config/modules/__tests__/renderRoutes-test.js

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
import renderRoutes from '../renderRoutes'
2-
import expect from 'expect'
31
import React from 'react'
4-
import { renderToString } from 'react-dom/server'
2+
import ReactDOMServer from 'react-dom/server'
53
import StaticRouter from 'react-router/StaticRouter'
4+
import renderRoutes from '../renderRoutes'
65

76
describe('renderRoutes', () => {
87
let rendered
@@ -21,7 +20,7 @@ describe('renderRoutes', () => {
2120
}
2221
const routes = [routeToMatch]
2322

24-
renderToString(
23+
ReactDOMServer.renderToString(
2524
<StaticRouter location='/path' context={{}}>
2625
{renderRoutes(routes)}
2726
</StaticRouter>
@@ -40,7 +39,7 @@ describe('renderRoutes', () => {
4039
component: Comp
4140
}]
4241

43-
renderToString(
42+
ReactDOMServer.renderToString(
4443
<StaticRouter location='/' context={{}}>
4544
{renderRoutes(routes)}
4645
</StaticRouter>
@@ -65,7 +64,7 @@ describe('renderRoutes', () => {
6564
component: Comp
6665
}]
6766

68-
renderToString(
67+
ReactDOMServer.renderToString(
6968
<StaticRouter location='/' context={{}}>
7069
{renderRoutes(routes)}
7170
</StaticRouter>
@@ -92,7 +91,7 @@ describe('renderRoutes', () => {
9291
exact: true
9392
}, routeToMatch]
9493

95-
renderToString(
94+
ReactDOMServer.renderToString(
9695
<StaticRouter location='/path/child' context={{}}>
9796
{renderRoutes(routes)}
9897
</StaticRouter>
@@ -114,12 +113,12 @@ describe('renderRoutes', () => {
114113
}]
115114
}]
116115

117-
renderToString(
116+
ReactDOMServer.renderToString(
118117
<StaticRouter location='/path/child' context={{}}>
119118
{renderRoutes(routes)}
120119
</StaticRouter>
121120
)
122-
renderToString(
121+
ReactDOMServer.renderToString(
123122
<StaticRouter location='/' context={{}}>
124123
{renderRoutes(routes)}
125124
</StaticRouter>
@@ -144,12 +143,12 @@ describe('renderRoutes', () => {
144143
}]
145144
}]
146145

147-
renderToString(
146+
ReactDOMServer.renderToString(
148147
<StaticRouter location='/path/child/grandchild' context={{}}>
149148
{renderRoutes(routes)}
150149
</StaticRouter>
151150
)
152-
renderToString(
151+
ReactDOMServer.renderToString(
153152
<StaticRouter location='/path' context={{}}>
154153
{renderRoutes(routes)}
155154
</StaticRouter>
@@ -177,7 +176,7 @@ describe('renderRoutes', () => {
177176
// should render
178177
}, routeToMatch]
179178

180-
renderToString(
179+
ReactDOMServer.renderToString(
181180
<StaticRouter location='/path/' context={{}}>
182181
{renderRoutes(routes)}
183182
</StaticRouter>
@@ -199,17 +198,17 @@ describe('renderRoutes', () => {
199198
}]
200199
}]
201200

202-
renderToString(
201+
ReactDOMServer.renderToString(
203202
<StaticRouter location='/path/child' context={{}}>
204203
{renderRoutes(routes)}
205204
</StaticRouter>
206205
)
207-
renderToString(
206+
ReactDOMServer.renderToString(
208207
<StaticRouter location='/' context={{}}>
209208
{renderRoutes(routes)}
210209
</StaticRouter>
211210
)
212-
renderToString(
211+
ReactDOMServer.renderToString(
213212
<StaticRouter location='/path' context={{}}>
214213
{renderRoutes(routes)}
215214
</StaticRouter>
@@ -245,12 +244,12 @@ describe('renderRoutes', () => {
245244
}]
246245
}]
247246

248-
renderToString(
247+
ReactDOMServer.renderToString(
249248
<StaticRouter location='/path/child/grandchild' context={{}}>
250249
{renderRoutes(routes)}
251250
</StaticRouter>
252251
)
253-
renderToString(
252+
ReactDOMServer.renderToString(
254253
<StaticRouter location='/path/' context={{}}>
255254
{renderRoutes(routes)}
256255
</StaticRouter>

packages/react-router-dom/modules/__tests__/BrowserRouter-test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import expect from 'expect'
22
import React from 'react'
3-
import PropTypes from 'prop-types'
43
import ReactDOM from 'react-dom'
4+
import PropTypes from 'prop-types'
55
import BrowserRouter from '../BrowserRouter'
66

77
describe('A <BrowserRouter>', () => {

packages/react-router-dom/modules/__tests__/HashRouter-test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import expect from 'expect'
22
import React from 'react'
3-
import PropTypes from 'prop-types'
43
import ReactDOM from 'react-dom'
4+
import PropTypes from 'prop-types'
55
import HashRouter from '../HashRouter'
66

77
describe('A <HashRouter>', () => {

packages/react-router-dom/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@
2020
"Router.js",
2121
"StaticRouter.js",
2222
"Switch.js",
23+
"es",
2324
"index.js",
2425
"matchPath.js",
2526
"withRouter.js",
26-
"es",
2727
"umd"
2828
],
2929
"main": "index.js",

packages/react-router-native/BackButton.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
import React, { Component } from 'react'
1+
import React from 'react'
22
import PropTypes from 'prop-types'
33
import { BackHandler } from 'react-native'
44

5-
class BackButton extends Component {
5+
class BackButton extends React.Component {
66
static contextTypes = {
77
router: PropTypes.shape({
88
history: PropTypes.shape({
@@ -22,6 +22,7 @@ class BackButton extends Component {
2222

2323
handleBack = () => {
2424
const { history } = this.context.router
25+
2526
if (history.index === 0) {
2627
return false // home screen
2728
} else {
@@ -31,7 +32,7 @@ class BackButton extends Component {
3132
}
3233

3334
render() {
34-
return this.props.children || null;
35+
return this.props.children || null
3536
}
3637
}
3738

packages/react-router-native/index.android.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
import React, { Component } from 'react'
1+
import React from 'react'
22
import { AppRegistry, StyleSheet, Text, View } from 'react-native'
33

44
import { NativeRouter, Route, Link, DeepLinking, AndroidBackButton, Prompt } from './main'
55

6-
export default class ReactRouterNative extends Component {
6+
export default class ReactRouterNative extends React.Component {
77
render() {
88
return (
99
<NativeRouter>
@@ -39,7 +39,7 @@ export default class ReactRouterNative extends Component {
3939
)}/>
4040
</View>
4141
</NativeRouter>
42-
);
42+
)
4343
}
4444
}
4545

@@ -59,7 +59,7 @@ const styles = StyleSheet.create({
5959
textAlign: 'center',
6060
color: '#333333',
6161
marginBottom: 5,
62-
},
63-
});
62+
}
63+
})
6464

65-
AppRegistry.registerComponent('ReactRouterNative', () => ReactRouterNative);
65+
AppRegistry.registerComponent('ReactRouterNative', () => ReactRouterNative)
Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
import { AppRegistry } from 'react-native'
22

3-
import App from './examples/BasicExample'
4-
//import App from './examples/ExperimentalExample'
3+
import ReactRouterNative from './examples/BasicExample'
4+
//import ReactRouterNative from './examples/ExperimentalExample'
55

6-
AppRegistry.registerComponent('ReactRouterNative', () => App)
6+
export default ReactRouterNative
7+
8+
AppRegistry.registerComponent('ReactRouterNative', () => ReactRouterNative)

0 commit comments

Comments
 (0)