Skip to content

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

@imranbarbhuiya

Description

@imranbarbhuiya

πŸ”Ž 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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions