我有Router
设置,有2个标签场景:
代码如下。
app.js:
import React from 'react';
import { Router, Scene } from 'react-native-router-flux';
import Tab from '../tab';
import ScreenA from './a';
import ScreenB from './b';
import ScreenC from './c';
export default class App extends React.Component {
render(){
return (
<Router>
<Scene key="root">
<Scene key="tabbar" tabs={true}>
<Scene key="tab1" title="Tab 1" icon={Tab}>
<Scene key="a" title="Screen A" component={ScreenA} />
<Scene key="b" title="Screen B" component={ScreenB} />
</Scene>
<Scene key="tab2" title="Tab 2" icon={Tab}>
<Scene key="c" title="Screen C" component={ScreenC} />
</Scene>
</Scene>
</Scene>
</Router>
);
}
}
屏幕也非常简单。
a.js:
export default class ScreenA extends React.Component {
render(){
return (
<View>
<Text>This is Screen A</Text>
<TouchableHighlight onPress={() => Actions.b()}>
<Text>Go to Screen B</Text>
</TouchableHighlight>
</View>
);
}
}
b.js:
export default class ScreenB extends React.Component {
render(){
return (
<View>
<Text>This is Screen B</Text>
</View>
);
}
}
c.js:
export default class ScreenC extends React.Component {
render(){
return (
<View>
<Text>This is Screen C</Text>
</View>
);
}
}
react-native-router-flux
未保留标签&#39;我们回到他们的历史堆栈。或者我在这里做错了什么?
套餐版本: