React Native Drawer - 无法读取未定义的属性“isConfigured”并且[Reanimated]无法创建工作集

问题描述 投票:0回答:2

我的代码:

/**
 * Sample React Native App
 * https://github.com/facebook/react-native
 *
 * @format
 */
import React from 'react';
import { createDrawerNavigator} from '@react-navigation/drawer';
import { NavigationContainer } from '@react-navigation/native';
import StockRoom from './StockRoom';
const Drawer = createDrawerNavigator();

function Refill(navigation: any): React.JSX.Element {
  interface CustomAlertProps {
    show: boolean;
    onClose: () => void;
  }

  return (
    <NavigationContainer independent={true}>
      <Drawer.Navigator>
        <Drawer.Screen name="Home" component={StockRoom} />
      </Drawer.Navigator>
    </NavigationContainer>
    
  );
}


export default Refill;

第一个错误:

第二个错误:

我需要创建一个简单的抽屉,但我做不到。 我该如何解决这两个问题? 我尝试了 npm uninstall 并再次下载所有软件包,但不起作用。

reactjs react-native navigation-drawer
2个回答
0
投票

我使用 React Navigation Stack Navigator 遇到了与此非常相似的问题。通过删除

node_modules
、清除 npm 和 gradle 构建缓存、重新安装依赖项,它就消失了。另外,我必须将
react-native-reanimated
添加到我的项目依赖项中。完成此操作后,一切对我来说都进展顺利。

希望这有帮助!


0
投票

最新版本的reanimated无法与抽屉正常配合使用 尝试安装这个版本的 reamened npm i [电子邮件受保护]

© www.soinside.com 2019 - 2024. All rights reserved.