Actions.key无法正常工作

时间:2018-03-06 14:07:36

标签: javascript reactjs react-native react-native-router-flux

我正在实现一个按钮,当按下该按钮时,会使用react-native-router-flux。

进入新屏幕
import {Scene, Router, Actions} from 'react-native-router-flux';

 render() {

    <Router>
      <Scene key="root">
        <Scene key="settings" component={App}/>
      </Scene>
    </Router>

  return (
    <View>
      <Animated.View style={{position: "absolute", width: "100%", backgroundColor: THEME_COLOR, zIndex: 1}}>
        <Header style={{backgroundColor: THEME_COLOR}} hasTabs>
          <Body>
              <TouchableOpacity onPress={ () => (Actions.settings)} style= {{alignSelf: 'flex-end'}}>

                <Text style={{color: "white"}}>
                  Settings
                </Text>
              </TouchableOpacity>
          <Title>
            <Animated.Text style={{color: 'white', fontWeight: "bold"}}>
              Messages
            </Animated.Text>
          </Title>
          </Body>
        </Header>
      </Animated.View>

但是当我点击按钮(atm只显示&#39;设置&#39;的文字)没有任何反应时,我是否错误地实现了路由器组件,或者我调用它是错误的?

0 个答案:

没有答案