react-native 在更改括号位置时出现错误

0kjbasz6  于 8个月前  发布在  React
关注(0)|答案(3)|浏览(223)

描述

当我在return语句后的括号行中进行更改时,我遇到了一个错误。

重现步骤

使用typescript模板启动一个基本的react应用。

React Native版本

0.74.1

受影响的平台

运行时-桌面

npx react-native info的输出

  1. System:
  2. OS: Windows 10 10.0.19045
  3. CPU: (8) x64 11th Gen Intel(R) Core(TM) i5-1135G7 @ 2.40GHz
  4. Memory: 4.90 GB / 15.74 GB
  5. Binaries:
  6. Node:
  7. version: 20.12.2
  8. path: C:\Program Files\nodejs\node.EXE
  9. Yarn: Not Found
  10. npm:
  11. version: 10.5.0
  12. path: C:\Program Files\nodejs\npm.CMD
  13. Watchman: Not Found
  14. SDKs:
  15. Android SDK: Not Found
  16. Windows SDK: Not Found
  17. IDEs:
  18. Android Studio: Not Found
  19. Visual Studio:
  20. - 17.9.34723.18 (Visual Studio Community 2022)
  21. Languages:
  22. Java: 17.0.10
  23. Ruby: Not Found
  24. npmPackages:
  25. "@react-native-community/cli": Not Found
  26. react:
  27. installed: 18.3.1
  28. wanted: ^18.3.1
  29. react-native: Not Found
  30. react-native-windows: Not Found
  31. npmGlobalPackages:
  32. "*react-native*": Not Found
  33. Android:
  34. hermesEnabled: Not found
  35. newArchEnabled: Not found
  36. iOS:
  37. hermesEnabled: Not found
  38. newArchEnabled: Not found

堆栈跟踪或日志

  1. N/A

可复现问题

https://github.com

截图和视频

omvjsjqw

omvjsjqw1#

⚠️缺失可复现示例
i️我们无法在您的问题报告中检测到可复现的示例。请提供以下内容:* 如果您的错误与UI相关:一个 Snack* 如果您的错误与构建/更新相关:使用我们的 Reproducer Template 。需要在您用户名下的GitHub仓库中有一个复现器。
emeijp43

emeijp432#

如果我在return语句后的括号行更改,我将得到一个错误。错误是什么?

mo49yndu

mo49yndu3#

App 不能作为 JSX 组件使用。
它的类型 () => void 不是一个有效的 JSX 元素类型。
类型 () => void 不能分配给类型 (props: any, deprecatedLegacyContext?: any) => ReactNode
类型 void 不能分配给类型 ReactNode

相关问题