Skip to content

Latest commit

 

History

History
35 lines (28 loc) · 1 KB

navigation.md

File metadata and controls

35 lines (28 loc) · 1 KB

Navigation

history objects may be used to programmatically change the current location using the following methods:

An example:

// Push a new entry onto the history stack.
history.push('/home');

// Push a new entry onto the history stack with a query string
// and some state. Location state does not appear in the URL.
history.push('/home?the=query', { some: 'state' });

// If you prefer, use a location-like object to specify the URL.
// This is equivalent to the example above.
history.push({
  pathname: '/home',
  search: '?the=query'
}, {
  some: state
});

// Go back to the previous history entry. The following
// two lines are synonymous.
history.go(-1);
history.back();