Skip to content

Commit bd3265a

Browse files
committed
Tweak error messaging
1 parent 172dc16 commit bd3265a

File tree

6 files changed

+8
-8
lines changed

6 files changed

+8
-8
lines changed

packages/react-router/modules/Prompt.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ class Prompt extends React.Component {
4444
componentWillMount() {
4545
invariant(
4646
this.context.router,
47-
'You should not use <Prompt> outside a valid <Router>'
47+
'You should not use <Prompt> outside a <Router>'
4848
)
4949

5050
if (this.props.when)

packages/react-router/modules/Redirect.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ class Redirect extends React.Component {
3737
componentWillMount() {
3838
invariant(
3939
this.context.router,
40-
'You should not use <Redirect> outside a valid <Router>'
40+
'You should not use <Redirect> outside a <Router>'
4141
)
4242

4343
if (this.isStatic())

packages/react-router/modules/Route.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ class Route extends React.Component {
5959

6060
invariant(
6161
router,
62-
'You should not use <Route> or withRouter() outside a valid <Router>'
62+
'You should not use <Route> or withRouter() outside a <Router>'
6363
)
6464

6565
const { route } = router

packages/react-router/modules/Switch.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ class Switch extends React.Component {
2222
componentWillMount() {
2323
invariant(
2424
this.context.router,
25-
'You should not use <Switch> outside a valid <Router>'
25+
'You should not use <Switch> outside a <Router>'
2626
)
2727
}
2828

packages/react-router/modules/__tests__/Route-test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,14 +88,14 @@ describe('A <Route>', () => {
8888
expect(node.innerHTML).toContain('/sushi/spicy-tuna')
8989
})
9090

91-
it('crash explicitly with no valid <Router>', () => {
91+
it('throws with no <Router>', () => {
9292
const node = document.createElement('div')
9393

9494
expect(() => {
9595
ReactDOM.render((
9696
<Route path="/" render={() => null} />
9797
), node)
98-
}).toThrow(/You should not use <Route> or withRouter\(\) outside a valid <Router>/)
98+
}).toThrow(/You should not use <Route> or withRouter\(\) outside a <Router>/)
9999
})
100100
})
101101

packages/react-router/modules/__tests__/Switch-test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ describe('A <Switch>', () => {
135135
expect(node.innerHTML).toMatch(/one/)
136136
})
137137

138-
it('crash explicitly with no valid <Router>', () => {
138+
it('throws with no <Router>', () => {
139139
const node = document.createElement('div')
140140

141141
expect(() => {
@@ -149,7 +149,7 @@ describe('A <Switch>', () => {
149149
)}/>
150150
</Switch>
151151
), node)
152-
}).toThrow(/You should not use <Switch> outside a valid <Router>/)
152+
}).toThrow(/You should not use <Switch> outside a <Router>/)
153153
})
154154
})
155155

0 commit comments

Comments
 (0)