---
schema_version: "1"
id: 667b4eda26ac05faaa9f49969c5887b220dcdaa7b76dd109c5e06aa03e00faac
title: Navigate To Component (Deprecated)
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/force/navigateToComponent/force-navigate-to-component.md
canonical_url: https://developer.salesforce.com/docs/platform/lightning-component-reference/guide/force-navigate-to-component.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: bbe7f7763857600ac333c43e057ed4a0a46bd574068aa21caeb50af554ee22a8
products:
  - Lightning Component Reference
---
# Navigate To Component (Deprecated)

**`force:navigateToComponent`**

Navigates from an Aura component to another.

This event is deprecated. We recommend using the [`lightning:navigation` component](/docs/platform/lightning-component-reference/guide/aura-navigation.html) with the `standard__component` page type instead.

**For Use In**

Lightning Experience, Experience Builder Sites, Salesforce Mobile App

::::::tabset{tabs='[ "Develop", "Specifications"]'}

:::::tab

This event enables you to navigate from one Aura component to another.

**note:** Starting in API version 43.0, the `force:navigateToComponent` event is deprecated. For more information, see [Components with Minimum API Version Requirements](https://developer.salesforce.com/docs/atlas.en-us.lightning.meta/lightning/components_versioning_min_version.htm). We recommend implementing the `lightning:isUrlAddressable` interface on your target component and navigating to the component using [the `lightning:navigation` component](http://developer.salesforce.com/docs/atlas.en-us.lightning.meta/lightning/components_navigation.htm) with the `standard__component` page type instead. This generates a route in the format `/cmp/{componentName}?myAttr=attrValue`.

To navigate from a component to another, specify the component name using `componentDef`. This example navigates to a component `c:myComponent` and sets a value on the `contactId` attribute. The `componentAttributes` are base-64 encoded into the URL.

```javascript
navigateToMyComponent : function(component, event, helper) {
    var evt = $A.get("e.force:navigateToComponent");
    evt.setParams({
        componentDef : "c:myComponent",
        componentAttributes: {
            contactId : component.get("v.contact.Id")
        }
    });
    evt.fire();
}
```

**important:** Even when using HTTPS, including personal data for URL parameters isn’t safe. See [Storing Sensitive Data](https://developer.salesforce.com/docs/atlas.en-us.secure_coding_guide.meta/secure_coding_guide/secure_coding_storing_sensitive_data.htm) for details.

When fired from a component embedded in Lightning Experience or Salesforce mobile app, the app creates and renders the target component in the app content area, replacing the current content. If you create a tab and associate it directly with the component, this event lets you navigate to the tab associated with the target component. For more information, see [Add Lightning Components as Custom Tabs in a Lightning App](https://help.salesforce.com/s/articleView?id=platform.aura_add_cmp_lex.htm).

This event doesn’t support target components that are embedded in another tab or in multiple tabs. You can navigate only to a component that’s marked `access="global"` or a component within the current namespace. Don’t depend on the URL generated by this event. It appears in the browser location bar and can be bookmarked, but the URL isn’t permanent.

This event is handled by the `one.app` container. It’s supported in Lightning Experience and the Salesforce mobile app.


:::::

:::::tab
## Attributes

| Name                  | Description                                                                                                                                                             | Type    | Default | Required |
| --------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------- | ------- | -------- |
| `componentAttributes` | The attributes for the component.                                                                                                                                       | object  |         |          |
| `componentDef`        | The component to navigate to, for example, `c:myComponent`.                                                                                                             | string  |         |          |
| `isredirect`          | Specifies whether the navigation is a redirect. If true, the browser replaces the current URL with the new one in the navigation history. This value defaults to false. | boolean | false   |          |

:::::

::::::
