Skip to content

Instantly share code, notes, and snippets.

@callmephilip
Created May 18, 2016 15:37
Show Gist options
  • Save callmephilip/fcbff08897c2fb5762bdf7ef73607fbc to your computer and use it in GitHub Desktop.
Save callmephilip/fcbff08897c2fb5762bdf7ef73607fbc to your computer and use it in GitHub Desktop.
/*
*
* GlobalNavigation reducer
*
*/
import ReactNative from 'react-native';
const { NavigationExperimental } = ReactNative;
const { Reducer: NavigationReducer } = NavigationExperimental;
const globalNavigation = NavigationReducer.StackReducer({
getPushedReducerForAction: (action) => {
if (action.type === 'push') {
return (state) => (state || action.route);
}
return null;
},
initialState: {
key: 'global',
index: 0,
children: [
{
key: 'applicationTabs',
index: 0
},
],
},
});
module.exports = globalNavigation;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment