Skip to content

Latest commit

 

History

History
22 lines (16 loc) · 465 Bytes

File metadata and controls

22 lines (16 loc) · 465 Bytes
title useHref

useHref

Type declaration
declare function useHref(to: To): string;

The useHref hook returns a URL that may be used to link to the given to location, even outside of React Router.

Tip:

You may be interested in taking a look at the source for the <Link> component in react-router-dom to see how it uses useHref internally to determine its own href value.