Options
All
  • Public
  • Public/Protected
  • All
Menu

External module "lib/pop"

Index

Functions

findLastIndex

  • findLastIndex<T, This>(array: ReadonlyArray<T>, callback: function, that?: This): number
  • Type parameters

    • T

    • This

    Parameters

    • array: ReadonlyArray<T>
    • callback: function
        • (this: This, data: T, index: number, array: ReadonlyArray<T>): void
        • Parameters

          • this: This
          • data: T
          • index: number
          • array: ReadonlyArray<T>

          Returns void

    • Optional that: This

    Returns number

findScreen

  • findScreen<P>(screen: ScreenComponentClass<P>): number
  • Type parameters

    • P

    Parameters

    • screen: ScreenComponentClass<P>

    Returns number

pop

  • pop<P>(countOrScreen?: number | ScreenComponentClass<P>): void
  • Pops a screen, or multiple, from the stack

    throws

    {RangeError} if countOrScreen was a screen and was not found in the stack

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

    export class MyScreen extends React.PureComponent { private readonly navigateToNavigation = (): void => { // Pop all screen that are above this screen in the stack pop(MyScreen);

    // Pop last screen
    pop();
    
    // Pop multiple screens
    pop(2);

    } } `

    Type parameters

    • P

    Parameters

    • Default value countOrScreen: number | ScreenComponentClass<P> = 1

      the number of screens to pop from the stack. This can also be a screen that is already in the stack, all screens up to that screen will be popped

    Returns void