---
schema_version: "1"
id: 2d28ec303d87c64392bdbfa133a647b80ed5f6f731fb6f7ad17f7ecc6064b843
title: Has Page Reference
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/lightning-base-components/lightning-design-system/guides/aura/components/lightning/hasPageReference/aura-has-page-reference.md
canonical_url: https://developer.salesforce.com/docs/platform/lightning-component-reference/guide/aura-has-page-reference.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: 6628739411ffe9ba12638deb1e1ec2f1e5135dca6dd766bf2c62afa6af98a6bc
products:
  - Lightning Component Reference
---
# Has Page Reference

**`lightning:hasPageReference`**

Enables a component to take a `pageReference` object as an attribute.

**For Use In**

Lightning Experience, Salesforce Mobile App

::::::tabset{tabs='[ "Develop", "Specifications"]'}

:::::tab

Implement the `lightning:hasPageReference` interface to indicate that a Lightning component can accept a `pageReference` object. This capability comes by default when implementing `lightning:isUrlAddressable`. This interface isn't supported for components that are embedded in a flexipage.

Implementing `lightning:hasPageReference` provides access to the `pageReference` attribute. When populated, the `pageReference` attribute describes the current page, including its type and attributes. Only top-level page components can receive the `pageReference` attribute. See [pageReference types](https://developer.salesforce.com/docs/atlas.en-us.lightning.meta/lightning/components_navigation_page_definitions.htm) in the Lightning Aura Components Developer Guide.

By using `lightning:navigation`, you can jump to one of these pages or components, without needing to craft a URL by hand. Note that the `pageReference` attribute is deeply frozen and cannot be modified. See the [`lightning:isUrlAddressable` documentation](/docs/platform/lightning-component-reference/guide/aura-is-url-addressable.html) for examples on using and changing the `pageReference`.

To update a parameter on the `pageReference` while staying on the current page, use a change handler to listen for page state updates. Updating a parameter also updates the URL so that some state or data that the page holds can be retained, even when the page refreshes.

When the target of a navigation action maps to the same component, the routing container might simply update the `pageReference` attribute value instead of recreating the component. In this scenario, a change handler ensures that your component reacts correctly.

The `pageReference` attribute can be populated only for the following page types:

- standard\_\_component
- standard\_\_navItemPage (for Lightning component tab only)
- standard\_\_recordPage
- standard\_\_objectPage

## See Also

[Navigate to a Record Create Page with Default Field Values](https://developer.salesforce.com/docs/atlas.en-us.lightning.meta/lightning/components_navigation_dfv.htm)


:::::

:::::tab
![No specifications to show](https://developer.salesforce.com/media/no-specs.png)

:::::

::::::
