facebook / react-native

A framework for building native applications using React
https://reactnative.dev
MIT License
116.27k stars 23.99k forks source link

Getting error when changing parenthesis position #44468

Open divyaansh0105 opened 1 week ago

divyaansh0105 commented 1 week ago

Description

I am getting an error if I change the line of parenthesis after the return statement

Steps to reproduce

Start a basic react app using typescript template

React Native Version

0.74.1

Affected Platforms

Runtime - Desktop

Output of npx react-native info

System:
  OS: Windows 10 10.0.19045
  CPU: (8) x64 11th Gen Intel(R) Core(TM) i5-1135G7 @ 2.40GHz
  Memory: 4.90 GB / 15.74 GB
Binaries:
  Node:
    version: 20.12.2
    path: C:\Program Files\nodejs\node.EXE
  Yarn: Not Found
  npm:
    version: 10.5.0
    path: C:\Program Files\nodejs\npm.CMD
  Watchman: Not Found
SDKs:
  Android SDK: Not Found
  Windows SDK: Not Found
IDEs:
  Android Studio: Not Found
  Visual Studio:
    - 17.9.34723.18 (Visual Studio Community 2022)
Languages:
  Java: 17.0.10
  Ruby: Not Found
npmPackages:
  "@react-native-community/cli": Not Found
  react:
    installed: 18.3.1
    wanted: ^18.3.1
  react-native: Not Found
  react-native-windows: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: Not found
  newArchEnabled: Not found
iOS:
  hermesEnabled: Not found
  newArchEnabled: Not found

Stacktrace or Logs

N/A

Reproducer

https://github.com

Screenshots and Videos

Screenshot (152) Screenshot (151)

github-actions[bot] commented 1 week ago
:warning: Missing Reproducible Example
:information_source: We could not detect a reproducible example in your issue report. Please provide either:
  • If your bug is UI related: a Snack
  • If your bug is build/update related: use our Reproducer Template. A reproducer needs to be in a GitHub repository under your username.
cortinico commented 1 week ago

I am getting an error if I change the line of parenthesis after the return statement

What is the error?

divyaansh0105 commented 1 week ago

Screenshot (156)

'App' cannot be used as a JSX component. Its type '() => void' is not a valid JSX element type. Type '() => void' is not assignable to type '(props: any, deprecatedLegacyContext?: any) => ReactNode'. Type 'void' is not assignable to type 'ReactNode'.