Last active
March 24, 2016 18:08
-
-
Save bfagundez/8061c16ca76231431408 to your computer and use it in GitHub Desktop.
react native routing with navigator
This file contains 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 HomePage from './app/components/anonymous/home/homepage' | |
import SignUp from './app/components/anonymous/signup/signup' | |
import Market from './app/components/authenticated/market/market' | |
import Shop from './app/components/authenticated/market/shop/shop' | |
class PackShop extends Component { | |
render() { | |
return ( | |
<Navigator | |
style={{ flex:1 }} | |
initialRoute={{ name: 'Shop' }} | |
renderScene={ this.renderScene } | |
/> | |
); | |
} | |
renderScene(route,nav) { | |
console.log('returning this crap, render scene',route,nav) | |
switch (route.name) { | |
case "HomePage": | |
return <HomePage navigator={nav} ></HomePage> | |
case "SignUp": | |
return <SignUp navigator={nav} ></SignUp> | |
case "Market": | |
return <Market navigator={nav} ></Market> | |
default: | |
case "Shop": | |
return <Shop navigator={nav} ></Shop> | |
default: | |
break; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment