Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface IBackend

An interface that navigation backend library integrations must implement to allow the EF Carbon navigation API to work with it

Hierarchy

  • IBackend

Implemented by

Index

Methods

create

  • Creates the navigation component. This will be the component that will replace the Navigator component once loaded

    Parameters

    Returns React.ReactNode

fullscreen

  • Pushes a fullscreen display onto the stack

    example
    screen/Main/Component.tsx ```ts import * as React from 'react'; import { fullscreen } from '@ef-carbon/react-native-navigation';

    export class MyScreen extends React.PureComponent { private readonly showFullscreen = (): void => { const instance = fullscreen(This will be shown in the fullscreen display); instance.visible; // -> true // Some point later instance.close(); instance.visible; // -> false } } `

    Parameters

    • node: React.ReactNode

      the elements to render inside the fullscreen element

    • options: IFullscreenOptions

    Returns IFullscreen

    the interface to programatically close the fullscreen display

modal

  • Pushes a modal onto the stack

    example
    screen/Main/Component.tsx ```ts import * as React from 'react'; import { modal } from '@ef-carbon/react-native-navigation';

    export class MyScreen extends React.PureComponent { private readonly showModal = (): void => { const instance = modal(This will be shown in the modal); instance.visible; // -> true // Some point later instance.close(); instance.visible; // -> false } } `

    Parameters

    • node: React.ReactNode

      the elements to render inside the modal

    • options: IModalOptions

    Returns IModal

    the interface to programatically close the modal

pop

  • pop(count: number): void
  • Pops a number of screens off the stack

    Parameters

    • count: number

      the number of screens to pop off the stack. Can be Infinity to pop all screens and return to the default route

    Returns void

push

  • push<P>(screen: ScreenComponentClass<P>, props: P): void
  • Pushes a screen onto the stack

    example
    How to push a screen onto the stack ```ts import OtherScreen from '../OtherScreen';

    export class MainScreen extends React.PureComponent { private readonly navigateToOtherScreen = (): void => { // This does type checked pushing of a new screen to the stack // You would usually do a more production way to handle the errors push(OtherScreen, { firstName: 'Joe', secondName: 'Bloggs' }).catch(console.error); } } `

    Type parameters

    • P

    Parameters

    • screen: ScreenComponentClass<P>

      the screen that should be added to the stack

    • props: P

      the properties that should be applied to the screen

    Returns void

replace

  • replace<P>(screen: ScreenComponentClass<P>, props: P): void
  • Replaces the current screen on the stack

    Type parameters

    • P

    Parameters

    • screen: ScreenComponentClass<P>

      the screen that should be put in place at the top of the stack

    • props: P

      the properties that should be applied to the screen

    Returns void

reset

  • reset<P>(screen: ScreenComponentClass<P>, props: P): void
  • Resets the whole stack to a certain screen

    Type parameters

    • P

    Parameters

    • screen: ScreenComponentClass<P>

      the screen that should be put in place at the bottom of the stack

    • props: P

      the properties that should be applied to the screen

    Returns void