无法在React Native中设置标题和路由

时间:2018-10-15 07:32:47

标签: reactjs react-native react-navigation react-native-navigation

大家好,我刚刚开始学习React本机Redux,在使用T(n+1) <= 2*c(n+1) + 7*c(n+1) + n*c = 10*c*n之类的导航器之前,我只是使用export connect函数来使用React Redux .. 但现在我无法在类

中显示标题

这个方法也不起作用,谁能告诉我如何在我的本机应用程序中制作屏幕路由和标题

export default cart = createstacknavigator....

我的标头和路由器

    import {
      connect
    } from 'react-redux';
    import {
      counterDecrement,


    } from './actions'






        class Cart extends React.Component {
    static navigationOptions = {
        title: "CART"
      }


      constructor(props) {
        super(props);
                    this.state = {
                      dataSource:[],isLoading : true,refreshing: false,
                  };}




  render() {

            if (this.state.isLoading == true) {
              return (
                <View style={{flex: 1, justifyContent:'center'}}>
                  <ActivityIndicator size="large" color="#4f9cdf"/>
                </View>
              );
            }


        return (
          <ScrollView>
          <View style={{padding:7,width:(Dimensions.get('window').width)}}>


            </View>
            </ScrollView>
        );
      }
    }

    function mapStateToProps(state) {
      return {
      counts:state
      }
    }

    export default connect(mapStateToProps, {counterDecrement})(Cart);

0 个答案:

没有答案