Added missing method getCurrentLocation to react-router/history

This commit is contained in:
Jan Bevers
2016-08-30 17:07:55 +02:00
parent d5424c1dc4
commit b83a05d335
2 changed files with 12 additions and 1 deletions
+11 -1
View File
@@ -129,4 +129,14 @@ let input = { value: "" };
history.createPath('/the/path') // /base/the/path
history.push('/the/path') // push /base/the/path
}
}
{
let history = createHistory()
const { pathname, query, search, state} = history.getCurrentLocation()
console.log(pathname)
console.log(query)
console.log(search)
console.log(state)
}
+1
View File
@@ -29,6 +29,7 @@ declare namespace HistoryModule {
createPath(path: LocationDescriptor): Path
createHref(path: LocationDescriptor): Href
createLocation(path?: LocationDescriptor, action?: Action, key?: LocationKey): Location
getCurrentLocation: () => Location
/** @deprecated use a location descriptor instead */
createLocation(path?: Path, state?: LocationState, action?: Action, key?: LocationKey): Location