t4t5 / react-native-router

Awesome navigation for your React Native app.
MIT License
1.17k stars 155 forks source link

how can i use route in titleComponent ? #71

Open SuperMoon opened 8 years ago

SuperMoon commented 8 years ago

I'm new to RN and react-native-router . How can I use routes in titleCompoent ? my code is something like this,it will cause an error :"this.props.toRoute is not a function" var TitleComp = React.createClass({ render:function(){ return (

aaa
    );
},
_toSearchPage: function(){
    this.props.toRoute({
        name: "To Search Page",
        component: SearchPage
    }
    );
}

});

var MyApp = React.createClass({ render:function() { return (

)

} }); var firstRoute = { name: 'Welcome!', titleComponent:TitleComp, component: SearchPage, };

AppRegistry.registerComponent('navProject', () => MyApp);

davidLeonardi commented 8 years ago

This component is currently defunct. Please adress questions here : github.com/MikaelCarpenter/gb-native-router