Skip to content

Commit 7160fb0

Browse files
committed
Update var names
1 parent ac715ca commit 7160fb0

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

packages/react-router/modules/Switch.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,15 +55,15 @@ class Switch extends React.Component {
5555
const { children } = this.props
5656
const { location } = this.state
5757

58-
let match, matchedRoute
59-
React.Children.forEach(children, route => {
58+
let match, child
59+
React.Children.forEach(children, element => {
6060
if (match == null) {
61-
matchedRoute = route
62-
match = matchPath(location.pathname, route.props)
61+
child = element
62+
match = matchPath(location.pathname, element.props)
6363
}
6464
})
6565

66-
return match ? React.cloneElement(matchedRoute, { computedMatch: match }) : null
66+
return match ? React.cloneElement(child, { computedMatch: match }) : null
6767
}
6868
}
6969

0 commit comments

Comments
 (0)