You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
optional user-defined reducer for scenes, you may want to use it to intercept all actions and put your custom logic
createReducer
function
function that returns a reducer function for {initialState, scenes} param, you may wrap Reducer(param) with your custom reducer, check Flux usage section below
other props
all properties that will be passed to all your scenes
children
required (if no scenes property passed)
Scene root element
scenes
object
optional
scenes for Router created with Actions.create. This will allow to create all actions BEFORE React processing. If you don't need it you may pass Scene root element as children
getSceneStyle
function
optional
Optionally override the styles for NavigationCard's Animated.View rendering the scene.
Scene:
Property
Type
Default
Description
key
string
required
Will be used to call screen transition, for example, Actions.name(params). Must be unique.
component
React.Component
semi-required
The Component to be displayed. Not required when defining a nested Scene, see example. If it is defined for 'container' scene, it will be used as custom container renderer
initial
bool
false
Set to true if this is the initial scene
type
string
ActionConst.PUSH or ActionConst.JUMP
Defines how the new screen is added to the navigator stack. One of ActionConst.PUSH, ActionConst.JUMP, ActionConst.REPLACE, ActionConst.RESET. If parent container is tabbar (tabs=true), ActionConst.JUMP will be automatically set.
clone
bool
Scenes marked with clone will be treated as templates and cloned into the current scene's parent when pushed. See example.
passProps
bool
false
Pass all own props (except style, key, name, component, tabs) to children. Note that passProps is also passed to children.
ActionConst:
We accept shorthand string literal when defining scene type or action params, like:
Optionally override the styles for NavigationCard's Animated.View rendering the scene. Receives first argument of NavigationSceneRendererProps and second argument of {hideNavBar,hideTabBar,isActive} (see Example app).
Tabs
Property
Type
Default
Description
tabs
bool
false
Defines 'TabBar' scene container, so child scenes will be displayed as 'tabs'. If no component is defined, built-in TabBar is used as renderer. All child scenes are wrapped into own navbar.
optional style override for the back title element
hideBackImage
boolean
false
no default back button image will be displayed
onBack
function
Actions.pop
actions for back button
Navigation Bar: Left button
Property
Type
Default
Description
leftTitle
string
optional string to display on the left if the previous route does not provide renderBackButton prop. renderBackButton > leftTitle > <previous route's title>
renderLeftButton
function
optional closure to render the left title / buttons element
onLeft
function
function will be called when left navBar button is pressed