The react-router
has a dependency on the history
package. The history
package is a JavaScript library utilized in maintaining sessions in any JavaScript application. Consider the following quote from the history
documentation (https://github.com/ReactTraining/history).
The history
object has several properties and methods:
action
: The current action,PUSH
,POP
, orREPLACE
.length
: The count of entries in thehistory
stack.location
: The current location, which includes thehash
,pathname
,search
, andstate
properties:hash
: Hash fragment.pathname
: URL path.search
: URL query string.state
: The state information provided when navigating from one route to the other, usinglocation.pushState
.
block()
: A function that registers a prompt message that will be displayed when the user tries to navigate away from the current page.createHref()
: A function that constructs a URL segment; it accepts an object with thepathname
,search
, andhash
properties.go(n)
: A function that navigates through the...