mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-16 06:50:19 +00:00
Added missing method getCurrentLocation to react-router/history
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
||||
Vendored
+1
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user