Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

React Native: 'React' refers to a umd global but the current file is a module consider adding an import instead

Tags:

react-native

I was getting this error while adding a View component in .tsx file.

like image 616
udai Avatar asked Sep 18 '17 10:09

udai


1 Answers

I raised this question and answered myself as I thought it will help others who are facing similar issue.

Please import React in your code import statements:

import * as React from 'react';

Reference:

https://github.com/Microsoft/TypeScript/issues/14118

like image 114
udai Avatar answered Oct 13 '22 23:10

udai