违反常态:元素类型无效

时间:2020-03-31 20:32:18

标签: react-native expo-cli

这是我面临的错误

this is the error i am facing

任何人都可以帮助我解决它。我被困在这里,无法解决,这是我的代码:

import React from 'react';
import 'react-native-gesture-handler';
import { createAppContainer } from 'react-navigation';
import { createStackNavigator } from 'react-navigation-stack';
import IndexScreen from './scr/screens/IndexScreen'
import {BlogProvider} from './scr/context/BlogContext';

const navigator = createStackNavigator(
  {
    Index: IndexScreen
   
  },
  {
    initialRouteName: 'Index',
    defaultNavigationOptions: {
      title: 'App'
    }
  }
);

const App =createAppContainer(navigator);
export default()=>{ 
  return(<BlogProvider>
 <App/></BlogProvider>)}
and BlogContext code 

import React from 'react';
import 'react-native-gesture-handler';
const BlogContext = React.createContext();
export const BlopProvider= ({Children})=>{
return <BlogContext.Provider>{Children}</BlogContext.Provider>

};

Blockquote

1 个答案:

答案 0 :(得分:0)

尝试删除导入行,

import `react-native-gesture-handler`;