Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Render Error: Property 'Button' doesn't exist

This is my first React Native project and I’m trying to learn, but I’m prevented from continuing because I keep receiving this error. This is a brand-new project created from the expo cli. As soon as I add the "Button" property I run into this error.

enter image description here

Here is my code:

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

import React from 'react';
import { StatusBar } from 'expo-status-bar';
import { StyleSheet, Text, View } from 'react-native';

export default function App() {
  return (
    <View style={styles.container}>
      <Button title='Push Me'/>
      <Text>Open up App.js to start working on your app!</Text>
      <StatusBar style="auto" />
    </View>
  );
}

const styles = StyleSheet.create({
  container: {
    flex: 1,
    backgroundColor: '#fff',
    alignItems: 'center',
    justifyContent: 'center',
  },
});

I am using the following dependencies:

  • "expo": "^49.0.3"
  • "expo-status-bar": "~1.2.0",
  • "react": "18.2.0",
  • "react-native": "0.71.8"

Please let me know if i am missing any important information.

>Solution :

You have to import the Button as well:

import { StyleSheet, Text, View, Button } from 'react-native';
                                 ^
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading