You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: packages/react-router/modules/Switch.js
+3-2Lines changed: 3 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -37,11 +37,12 @@ class Switch extends React.Component {
37
37
componentWillReceiveProps(nextProps){
38
38
warning(
39
39
!(nextProps.location&&!this.props.location),
40
-
'You cannot change from an uncontrolled to controlled Switch. You passed in a `location` prop on a re-render when initially there was none.'
40
+
'<Switch> elements should not change from controlled to uncontrolled (or vice versa). You initially used no "location" prop and then provided one on a subsequent render.'
41
41
)
42
+
42
43
warning(
43
44
!(!nextProps.location&&this.props.location),
44
-
'You cannot change from a controlled to an uncontrolled Switch. You passed in a `location` prop initially but on a re-render there was none.'
45
+
'<Switch> elements should not change from controlled to uncontrolled (or vice versa). You provided a "location" prop initially but omitted it on a subsequent render.'
0 commit comments