bpk-component-navigation-stack

3.1.13 • Public • Published

bpk-component-navigation-stack

Backpack navigation stack component.

Installation

npm install bpk-component-navigation-stack --save-dev

Usage

import React from 'react';
import BpkNavigationStack from 'bpk-component-navigation-stack';

export default () => (
  <BpkNavigationStack views={[<div />]} />
);

Props

Property PropType Required Default Value
views arrayOf(element) true -
className string false null

withNavigationStackState

withNavigationStackState returns a HOC with two instance methods, pushView and popView, that can be used to push and pop views from the stack component.

import React from 'react';
import BpkNavigationStack, { withNavigationStackState } from 'bpk-component-navigation-stack';

const StatefulNavigationStack = withNavigationStackState(BpkNavigationStack);

export default () => (
  <StatefulNavigationStack initialViews={[<div />]} />
);

By default the pushView and popView callbacks are forwarded to the children, if you want to disabled this behaviour pass false as the second argument, in this case the callbacks are forwarded to the Stack component instead.

Readme

Keywords

none

Package Sidebar

Install

npm i bpk-component-navigation-stack

Weekly Downloads

2

Version

3.1.13

License

Apache-2.0

Unpacked Size

31.2 kB

Total Files

13

Last publish

Collaborators

  • anambl
  • skyscanner-koalasquad
  • gert-jan.vercauteren
  • frugoman
  • marianeumayer-skyscanner
  • ojcurt
  • tiagohngl