Last active
October 22, 2017 07:02
-
-
Save benmort/b7a21f0c2acf1d649be3072cc2f58898 to your computer and use it in GitHub Desktop.
attempting to setup navigation from within redux actions... buut failing... any help would be awesome
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { NavigationActions } from 'react-navigation' | |
export function navIntro() { | |
return function(dispatch) { | |
dispatch(NavigationActions.navigate({ routeName: 'Intro' })) | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { Component } from 'react'; | |
import AppNavigator from './AppNavigator'; | |
import { Provider } from 'react-redux'; | |
import store from './store'; | |
export default class App extends Component { | |
render() { | |
return ( | |
<Provider store={store}> | |
<AppNavigator/> | |
</Provider> | |
) | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from "react"; | |
import { Platform, StatusBar } from "react-native"; | |
import { StackNavigator } from 'react-navigation/lib/react-navigation.js'; | |
import Home from "./screens/Home"; | |
import Intro from "./screens/Intro"; | |
const headerStyle = { | |
marginTop: Platform.OS === "android" ? StatusBar.currentHeight : 0 | |
}; | |
export const createRootNavigator = () => { | |
return StackNavigator( | |
{ | |
Home: { | |
screen: Home, | |
path: '', | |
navigationOptions: { | |
tabBarLabel: "Home" | |
} | |
}, | |
Intro: { | |
screen: Intro, | |
path: '', | |
navigationOptions: { | |
tabBarLabel: "Home" | |
} | |
} | |
}, | |
{ | |
headerMode: "none", | |
mode: "modal", | |
initialRouteName: "Home" | |
} | |
); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment