# Interface Navigator

A Navigator is a "location changer"; it's how you get to different locations.

Every history instance conforms to the Navigator interface, but the distinction is useful primarily when it comes to the low-level `<Router>` API where both the location and a navigator must be provided separately in order to avoid "tearing" that may occur in a suspense-enabled app if the action and/or location were to be read directly from the history instance.

interface Navigator {
createHref: ((to) => string);
encodeLocation?: ((to) => Path);
go: ((delta) => void);
push(to, state?, opts?): void;
replace(to, state?, opts?): void;
}

- Defined in common/temp/node_modules/.pnpm/react-router@6.23.1_react@18.3.1/node_modules/react-router/dist/lib/context.d.ts:74

#####
Index

### Properties

createHref
encodeLocation?
go

### Methods

push
replace

## Properties

### createHref

createHref: ((to) => string)

#### Type declaration

- - (to): string

  - Returns a valid href for the given `to` value that may be used as the value of an attribute.

    #### Parameters

    - to: To

      The destination URL

    #### Returns string

- Defined in common/temp/node_modules/.pnpm/react-router@6.23.1_react@18.3.1/node_modules/react-router/dist/lib/context.d.ts:75

### `Optional` encodeLocation

encodeLocation?: ((to) => Path)

#### Type declaration

- - (to): Path

  - Encode a location the same way window.history would do (no-op for memory history) so we ensure our PUSH/REPLACE navigations for data routers behave the same as POP

    #### Parameters

    - to: To

      Unencoded path

    #### Returns Path

- Defined in common/temp/node_modules/.pnpm/react-router@6.23.1_react@18.3.1/node_modules/react-router/dist/lib/context.d.ts:76

### go

go: ((delta) => void)

#### Type declaration

- - (delta): void

  - Navigates `n` entries backward/forward in the history stack relative to the current index. For example, a "back" navigation would use go(-1).

    #### Parameters

    - delta: number

      The delta in the stack index

    #### Returns void

- Defined in common/temp/node_modules/.pnpm/react-router@6.23.1_react@18.3.1/node_modules/react-router/dist/lib/context.d.ts:77

## Methods

### push

- push(to, state?, opts?): void

- #### Parameters

  - to: To
  - `Optional` state: any
  - `Optional` opts: NavigateOptions

  #### Returns void

  - Defined in common/temp/node_modules/.pnpm/react-router@6.23.1_react@18.3.1/node_modules/react-router/dist/lib/context.d.ts:78

### replace

- replace(to, state?, opts?): void

- #### Parameters

  - to: To
  - `Optional` state: any
  - `Optional` opts: NavigateOptions

  #### Returns void

  - Defined in common/temp/node_modules/.pnpm/react-router@6.23.1_react@18.3.1/node_modules/react-router/dist/lib/context.d.ts:79