match
The match
object contains information about how a <Route path>
matched the URL. match objects may contain the following properties:
- params
- type:
object
- default:
{}
- type:
Key/value pairs parsed from the URL corresponding to the dynamic segments of the path.
- path
- type:
string
- type:
The path
prop in innermost Route
.
- url
- type:
string
- type:
The matched prefix of the URL.
- isExact
- type:
bool
- type:
True if the entire URL was matched(url==history.location.pathname
)
match
object can be get by inject it to your component
@inject('match')
class MyView extends React.Component {
render(){
return <div>Current matched URL is: {this.props.match.url}</div>
}
}