不变违规:无效的挂接调用(本机响应)

时间:2020-06-07 16:20:49

标签: reactjs react-native

我遇到了屏幕上显示的问题,当我尝试在底部导航中调用课程时,出现以下错误。我已经附上了代码,请提出一个更好的方法

iPhone screenshot

这是我的主类,在这里我试图调用BlockList类

import React,{ Component } from 'react';
import { Platform, StyleSheet, Text, View } from 'react-native';

import { createMaterialBottomTabNavigator } from 'react-navigation-material-bottom-tabs';
import  { createAppContainer } from 'react-navigation' 
import Feather from 'react-native-vector-icons/Feather';
import AntIcons from 'react-native-vector-icons/AntDesign';
import MaterialIcons from 'react-native-vector-icons/MaterialIcons';

import BlockList from './components/BlockList';
import CallHeist from './components/CallHeist';
import OtpHeist from './components/OtpHeist';


const Navigator =  createMaterialBottomTabNavigator({

  BlockList: {screen: () => <BlockList />, navigationOptions: {
    tabBarLabel: 'abcd',
    tabBarIcon:({tintColor}) => (
      <MaterialIcons name="block" color={tintColor} size={20}/>
    )
  }}
}, {

  initialRouteName: 'abcd',
  activeColor: '#F44336',
  barStyle: { backgroundColor: '#fff' }
  }
);


export default createAppContainer(Navigator);

BlockList类

 class BlockList extends Component {
        render() {
                  return (
                  <View>

                  </View>);
    }
}

    export default BlockList;

0 个答案:

没有答案