5

this error is showing in my ios screen after downloading java script in my device.

ReferenceError: Can't find variable: Text

This error is located at:
in App (at registerRootComponent.js:35)
in RootErrorBoundary (at registerRootComponent.js:34)
in ExpoRootComponent (at renderApplication.js:33)
in RCTView (at View.js:60)
in View (at AppContainer.js:102)
in RCTView (at View.js:60)
in View (at AppContainer.js:122)
in AppContainer (at renderApplication.js:32)
mona alshehri
  • 71
  • 1
  • 2

2 Answers2

8

Import Text from react native.

 import {
      View,
      Text,
 } from 'react-native';
Pravin
  • 179
  • 1
  • 5
0

Importing react-native is not enough here.

Module not found: Can't resolve 'react-native'

Instead, you need an additional package:

yarn add react-native-web

Now you are able to use

import {Text} from 'react-native'
kwoxer
  • 3,167
  • 3
  • 35
  • 51