Reactjs 不变冲突:无效的挂钩调用(react native)
我正面临屏幕上显示的问题,当我试图调用底部导航中的类时,我得到以下错误。我已经附上代码,请建议一个更好的方法来做它 这是我的主类,在这个类中,我试图调用BlockList类Reactjs 不变冲突:无效的挂钩调用(react native),reactjs,react-native,Reactjs,React Native,我正面临屏幕上显示的问题,当我试图调用底部导航中的类时,我得到以下错误。我已经附上代码,请建议一个更好的方法来做它 这是我的主类,在这个类中,我试图调用BlockList类 import React,{ Component } from 'react'; import { Platform, StyleSheet, Text, View } from 'react-native'; import { createMaterialBottomTabNavigator } from 'react
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);
class BlockList extends Component {
render() {
return (
<View>
</View>);
}
}
export default BlockList;
import React,{Component}来自'React';
从“react native”导入{平台、样式表、文本、视图};
从“反应导航材料底部选项卡”导入{createMaterialBottomTabNavigator};
从“反应导航”导入{createAppContainer}
从“反应本机向量图标/羽毛”导入羽毛;
从“反应本机向量图标/AntDesign”导入反密码;
从“反应本机矢量图标/唯物主义者”导入唯物主义者;
从“./components/BlockList”导入区块列表;
从“./components/CallHeist”导入CallHeist;
从“./components/OtpHeist”导入OtpHeist;
const Navigator=createMaterialBottomTabNavigator({
区块列表:{screen:()=>,导航选项:{
tabBarLabel:'abcd',
tabBarIcon:({tintColor})=>(
)
}}
}, {
initialRouteName:'abcd',
activeColor:“#F44336”,
barStyle:{backgroundColor:'#fff'}
}
);
导出默认createAppContainer(导航器);
区块列表类
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);
class BlockList extends Component {
render() {
return (
<View>
</View>);
}
}
export default BlockList;
类块列表扩展组件{
render(){
返回(
);
}
}
导出默认阻止列表;