反应本机抽屉导航器

时间:2020-07-21 22:15:28

标签: react-native react-navigation

我是本机反应的新手,我实现了一个简单的本机抽屉,但是当我在模拟器中运行此代码时,它给我带来类型错误。

这是我的 drawr.js 代码:

import React, { Component } from 'react';
import {View,Text,FlatList} from "react-native";
import {Card} from "react-native-paper";
import  {DrawerNavigator} from 'react-navigation'

import lessons from './lessons';
import classes from './classes';



class Drawer extends React.Component{


    render() {
        return (
            <MyApp/>
        );
    }
}

const MyApp = DrawerNavigator({
    lessons:{
        screen:lessons
    }
})

export default Drawer;

然后我收到此错误:

enter image description here

如何解决此错误?

1 个答案:

答案 0 :(得分:0)

Ciao,您的代码中有一些错误。尝试遵循this指南。