# Navigation ## Element `Element (React.ComponentType)` --- ## registerComponent `registerComponent(componentName: string, getComponentClassFunc: ComponentProvider): React.ComponentType` [source](https://github.com/wix/react-native-navigation/blob/v2/lib/src/Navigation.ts#L52) Every navigation component in your app must be registered with a unique name. The component itself is a traditional React component extending React.Component. --- ## setRoot `setRoot(layout: any): Promise` [source](https://github.com/wix/react-native-navigation/blob/v2/lib/src/Navigation.ts#L59) Reset the app to a new layout --- ## setDefaultOptions `setDefaultOptions(options: any): void` [source](https://github.com/wix/react-native-navigation/blob/v2/lib/src/Navigation.ts#L66) Set default options to all screens. Useful for declaring a consistent style across the app. --- ## mergeOptions `mergeOptions(componentId: string, options: any): void` [source](https://github.com/wix/react-native-navigation/blob/v2/lib/src/Navigation.ts#L73) Change a component's navigation options --- ## showModal `showModal(layout: any): Promise` [source](https://github.com/wix/react-native-navigation/blob/v2/lib/src/Navigation.ts#L80) Show a screen as a modal. --- ## dismissModal `dismissModal(componentId: string): Promise` [source](https://github.com/wix/react-native-navigation/blob/v2/lib/src/Navigation.ts#L87) Dismiss a modal by componentId. The dismissed modal can be anywhere in the stack. --- ## dismissAllModals `dismissAllModals(): Promise` [source](https://github.com/wix/react-native-navigation/blob/v2/lib/src/Navigation.ts#L94) Dismiss all Modals --- ## push `push(componentId: string, layout: any): Promise` [source](https://github.com/wix/react-native-navigation/blob/v2/lib/src/Navigation.ts#L101) Push a new layout into this screen's navigation stack. --- ## pop `pop(componentId: string, params: any): Promise` [source](https://github.com/wix/react-native-navigation/blob/v2/lib/src/Navigation.ts#L108) Pop a component from the stack, regardless of it's position. --- ## popTo `popTo(componentId: string): Promise` [source](https://github.com/wix/react-native-navigation/blob/v2/lib/src/Navigation.ts#L115) Pop the stack to a given component --- ## popToRoot `popToRoot(componentId: string): Promise` [source](https://github.com/wix/react-native-navigation/blob/v2/lib/src/Navigation.ts#L122) Pop the component's stack to root. --- ## setStackRoot `setStackRoot(componentId: string, layout: any): Promise` [source](https://github.com/wix/react-native-navigation/blob/v2/lib/src/Navigation.ts#L129) Sets new root component to stack. --- ## showOverlay `showOverlay(layout: any): Promise` [source](https://github.com/wix/react-native-navigation/blob/v2/lib/src/Navigation.ts#L136) Show overlay on top of the entire app --- ## dismissOverlay `dismissOverlay(componentId: string): Promise` [source](https://github.com/wix/react-native-navigation/blob/v2/lib/src/Navigation.ts#L143) dismiss overlay by componentId --- ## events `events(): EventsRegistry` [source](https://github.com/wix/react-native-navigation/blob/v2/lib/src/Navigation.ts#L150) Obtain the events registry instance ---