可以在标签之间进行更改而不需要多一个课程?
在我的代码中,我有一个返回多个组件的类,我希望我的TabNavigator在这些组件之间切换,而不是像在React Navigation文档(https://reactnavigation.org/docs/tab-based-navigation.html)中那样在类之间切换。
class Monument extends Component{
render(){
const {navigate} = this.props.navigation;
const { data } = this.props.navigation.state.params;
return (
<MonumentMaker category={'Castelos'} navigate={navigate} data={data}/>
<MonumentMaker category={'Museus'} navigate={navigate} data={data}/>
<MonumentMaker category={'Igrejas'} navigate={navigate} data={data}/>
<MonumentMaker category={'Locais de Interesse'} navigate={navigate} data={data}/>
);
}
}
export default TabNavigator({
Convento: {
screen:**first component**
},
Museus: {
screen:**second component**
},
Igrejas: {
screen:**third component**
},
OutrosLocais: {
screen:**forth component**
}
})
我想要完成的是什么?
感谢您的帮助!
答案 0 :(得分:0)
您可以按照以下方式设置$(document).on('submit', 'form', function() {
setTimeout(function() {
window.location = "/thanks.html";
}, 1000);
});
TabNavigation
<强> Monument.js 强>
const myTabNavigator = TabNavigator({
Convento: {
screen: { screen: props => <Monument {...props} {...myProps} /> }
},
Museus: {
screen: { screen: props => <Monument {...props} {...myProps} /> }
},
Igrejas: {
screen: { screen: props => <Monument {...props} {...myProps} /> }
},
OutrosLocais: {
screen: { screen: props => <Monument {...props} {...myProps} /> }
}
})