Reactnativejs: Referenceerror: Can't Find Variable: View

Can't find Variable : "View"

add view to the import like this:

import {StyleSheet,View} from "react-native" ;

ReferenceError: Can't Find Variable

Try adding Button to the import like so:

import {
Platform,
StyleSheet,
Text,
View,
Button
} from 'react-native';

React Native ReferenceError Can't find variable

As Derek mentioned,

you have never defined MyAppHeader, therefore you will get error.

You could delete all <MyAppHeader></MyAppHeader> in your project, and it should work!

Otherwise you will need to defined MyAppHeader Component to make it works.

Clearly post for React Components Components and Props - React

Hope it will help.

Can't find variable: React

In the latest version of React Native you must import React from 'react' package

import React, {Component} from 'react';
import {
View,
...
} from 'react-native';


Related Topics



Leave a reply



Submit