react-navigation / react-navigation/react-navigation.github.io

Cannot convert undefined or null to object

未关闭
#1,348 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

主要语言
JavaScript
星标
324
派生
2k
PR 合并指标
30 天内没有已合并 PR

描述

app.js
/**

  • Sample React Native App
  • https://github.com/facebook/react-native
  • @format
    */
    import React from "react";
    import { Text, Button } from "react-native";
    import { Drawer } from "react-native-drawer-layout";

export default function App() {
const [open, setOpen] = React.useState(false);
return (
<Drawer
open={open}
onOpen={() => setOpen(true)}
onClose={() => setOpen(false)}
renderDrawerContent={() => {
return Drawer content;
}}
>
<Button onPress={() => setOpen(prevOpen => !prevOpen)} title={${open ? "Close" : "Open"} drawer} />

);
}

package.json

{
"name": "app_chinese_course",
"version": "0.0.1",
"private": true,
"scripts": {
"dev": "react-native run-android",
"android": "react-native run-android",
"ios": "react-native run-ios",
"lint": "eslint .",
"start": "react-native start",
"test": "jest",
"recache": "react-native start --reset-cache"
},
"dependencies": {
"@jamsch/react-native-hanzi-writer": "^0.3.1",
"@react-native-async-storage/async-storage": "^1.23.1",
"@react-navigation/bottom-tabs": "^6.5.20",
"@react-navigation/native": "^6.1.17",
"@react-navigation/stack": "^6.3.29",
"@reduxjs/toolkit": "^2.2.3",
"@splicer97/react-native-switch": "^1.0.0",
"axios": "^1.6.8",
"i18next": "^23.11.2",
"lottie-react-native": "^6.7.2",
"moment": "^2.30.1",
"qs": "^6.12.1",
"react": "18.2.0",
"react-i18next": "^14.1.1",
"react-native": "0.73.7",
"react-native-audio-recorder-player": "^3.6.7",
"react-native-calendars": "^1.1304.1",
"react-native-drawer-layout": "^3.3.1",
"react-native-fs": "^2.20.0",
"react-native-gesture-handler": "^2.17.1",
"react-native-linear-gradient": "^2.8.3",
"react-native-modal": "^13.0.1",
"react-native-progress": "^5.0.1",
"react-native-reanimated": "^3.14.0",
"react-native-safe-area-context": "^4.10.1",
"react-native-screens": "^3.31.1",
"react-native-splash-screen": "^3.3.0",
"react-native-storage": "^1.0.1",
"react-native-svg": "^13.4.0",
"react-native-video": "^5.2.1",
"react-redux": "^9.1.1"
},
"devDependencies": {
"@babel/core": "^7.20.0",
"@babel/preset-env": "^7.20.0",
"@babel/runtime": "^7.20.0",
"@react-native/babel-preset": "0.73.21",
"@react-native/eslint-config": "0.73.2",
"@react-native/metro-config": "0.73.5",
"@react-native/typescript-config": "0.73.1",
"babel-jest": "^29.6.3",
"eslint": "^8.19.0",
"eslint-plugin-react": "^7.34.1",
"jest": "^29.6.3",
"prettier": "2.8.8",
"react-native-devsettings": "^1.0.5",
"react-test-renderer": "18.2.0"
},
"engines": {
"node": ">=18"
}
}

贡献指南

这个仓库没有索引到贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

调研方向

首先,使用 package.json 中列出的依赖项和版本复现 app.js 中的错误,尤其是 react-native 0.73.7 和 react-native-drawer-layout 3.3.1。追踪报告 undefined 或 null 对象的位置,并将最小 Drawer 示例与已安装 package 的行为进行比较。完成结果应包括已确认的原因和记录在案的解决方案,但 issue 未定义具体要求的更改。

由索引模型根据 Issue 内容生成。

评估

技术栈
javascript, react-native
领域
mobile
Issue 类型
缺陷
难度
3/5
预计耗时
1-2 天
活跃度
停滞
描述清晰度
需要澄清
新手友好度
35/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。