1.4.1 • Published 5 years ago

use-history v1.4.1

Weekly downloads
15
License
ISC
Repository
github
Last release
5 years ago

use-history

the history api as a react hook

usage

import useHistory, {Link} from 'use-history'

const App = () => {
	const {url} = useHistory()

	return <>
		url is {url}
		<Link href='/hello'>go to /hello</Link>
	</>
}

it listens to popstate events while the component is mounted and rerenders when the url changes. Link is a boneless wrapper around <a> to update the url directly.

licence

ISC. © Bren Brightwell

1.4.1

5 years ago

1.4.0

5 years ago

1.3.4

5 years ago

1.3.3

5 years ago

1.3.2

5 years ago

1.3.1

5 years ago

1.3.0

5 years ago

1.2.0

5 years ago

1.1.0

5 years ago

1.0.0

5 years ago