Link
The Link
component is used to navigate between routes. Because it renders an underlying <a>
element, all properties available to the <a>
element are also available to the Link
component. For more information, refer to the <a>
element documentation.
Example code
Anchor link to section titled "Example code"
Name | Type | Description |
---|---|---|
to | string |
The destination URL that the link points to. This is the href attribute of the underlying <a> element. |
replace? | boolean |
Whether to update the state object or URL of the current history entry. Refer to the history.replaceState documentation. |
clientState? | any |
The custom client state with the navigation. |
reloadDocument? | boolean |
Whether to reload the whole document on navigation. |
prefetch? | boolean |
Whether to prefetch the link source when the user signals intent. Defaults to true . For more information, refer to Prefetching a link source. |
Component type
Anchor link to section titled "Component type"The Link
component is a client component, which means that it renders on the client. For more information about component types, refer to React Server Components.