Skip to content

'React' refers to a UMD global, but the current file is a module. Consider adding an import instead. #60588

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
imranbarbhuiya opened this issue Nov 25, 2024 · 1 comment Β· Fixed by #60615
Assignees

Comments

@imranbarbhuiya
Copy link

πŸ”Ž Search Terms

Hi, from ts 5.7, I'm getting the same error as reported in #60132 but for jsx: react-native. Wheneven I use <></>, I get the above error

πŸ•— Version & Regression Information

  • This changed between versions 5.6 and 5.7

⏯ Playground Link

https://www.typescriptlang.org/play/?jsx=3&ts=5.7.2#code/JYWwDg9gTgLgBAbzgNWAUwO5wL5wGZQQhwDkUaAhgMYwC0AdhTMAG5okDcAUF2gB6RY+AK70awCPTgBhIpHpp6MABQBKBD3IxhUKQB4AfFzhw9qTAb0B6cxiMmz6O9dv3TVo9iA

πŸ’» Code

import { View } from 'react-native';

export function Component(){

return <>
  <View></View>
  <View></View>
  </>
}

πŸ™ Actual behavior

The fragment shows an error

πŸ™‚ Expected behavior

This should work like ts 5.6 and shouldn't error

Additional information about the issue

No response

@iisaduan iisaduan self-assigned this Nov 25, 2024
@mrlika
Copy link

mrlika commented Nov 26, 2024

The issue is reproducible with the latest Expo 52 default app and TypeScript 5.7:

npx create-expo-app my-app
cd my-app
npx tsc

The issue is not reproducible with Expo 51 and TypeScript 5.7:

npx create-expo-app my-app --template default@51
cd my-app
npx tsc

But on Expo Discord channel think that the issue is in the latest TypeScript because it is not reproducible with lower versions of TypeScript and latest Expo 52.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants