Skip to content

Instantly share code, notes, and snippets.

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