We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ac715ca commit 7160fb0Copy full SHA for 7160fb0
packages/react-router/modules/Switch.js
@@ -55,15 +55,15 @@ class Switch extends React.Component {
55
const { children } = this.props
56
const { location } = this.state
57
58
- let match, matchedRoute
59
- React.Children.forEach(children, route => {
+ let match, child
+ React.Children.forEach(children, element => {
60
if (match == null) {
61
- matchedRoute = route
62
- match = matchPath(location.pathname, route.props)
+ child = element
+ match = matchPath(location.pathname, element.props)
63
}
64
})
65
66
- return match ? React.cloneElement(matchedRoute, { computedMatch: match }) : null
+ return match ? React.cloneElement(child, { computedMatch: match }) : null
67
68
69
0 commit comments