Error Encountered: The requested property 'Button' is not found

I'm encountering an error in my React Native project, and it's hindering my learning process. I just started this project with the expo cli, but as soon as I add the "Button" property, the error appears.

https://i.sstatic.net/A6py6.png

Below is the code snippet causing the issue:

import React from 'react';
import { StatusBar } from 'expo-status-bar';
import { StyleSheet, Text, View, Button } 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',
  },
});

These are the dependencies I am using:

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

If you have any insights or suggestions, please share them with me. It would be greatly appreciated!

Answer №1

Make sure to include the Button component:

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

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Gather information on a webpage

I am attempting to extract a table from the following page "https://www.hkex.com.hk/Mutual-Market/Stock-Connect/Statistics/Historical-Monthly?sc_lang=en#select1=0&select2=0". After using the inspect/network function in Chrome, it appears that the data ...

Node-red occasionally crashes and the JSON output may unexpectedly return HTML content

Having some trouble with my node-red crashing several times a day. I suspect that one of the issues may be related to an http request I am making. I'm trying to retrieve JSON data from a webpage, but sometimes I encounter errors in the log indicating ...

Using ES6 syntax to inject modules into an extended controller can result in the Unknown provider error

Currently, I am facing an issue with creating a child class ModalCtrlChild extends ModalCtrl from my controller class ModalCtrl. Whenever I attempt to do this, I encounter an unknown provider error related to the modules injected in ModalCtrl. The project ...

Check for criteria in database collection and send notification via email if requirements are satisfied || Utilizing MongoDB with

I have a scenario where I need to iterate through each element in the database and: if an element has the bumped field set to false and the creation date is less than 30 days ago then: update the bumped field to true send an email to the user! My ap ...

What is the best way to pass props from a parent component to a child component to initialize state in ReactJS?

I am attempting to set up the initial state in a child component called (EditUser) by passing props from its parent component below (App): class App extends React.Component{ state = { name: '', city: '', company: ''}; inApp = ...

What is the process for loading polymer?

I am new to polymer and currently trying to understand how it is loaded. I came across this useful resource that gives a brief overview: https://www.polymer-project.org/2.0/start/quick-tour In their basic example, they start by loading a polyfill: <s ...

Utilize Protractor Selenium to extract content from a popup window

Having trouble capturing the text from a popup using Protractor with getText? The HTML structure can be found here. This popup only appears for a few seconds before disappearing. Can anyone assist me in retrieving the text from this popup? To retrieve the ...

Encountered difficulties implementing Chart.js with Angular2

Greetings! I am currently attempting to utilize one of the Charts provided by http://www.chartjs.org, however, I seem to be encountering difficulties in getting it to function properly. I have followed the documentation by installing 'npm install char ...

Collaborate and apply coding principles across both Android and web platforms

Currently, I am developing a web version for my Android app. Within the app, there are numerous utility files such as a class that formats strings in a specific manner. I am wondering if there is a way to write this functionality once and use it on both ...

Upon returning to the website homepage from another page, the JavaScript animation ceases

I implemented a unique typewriter animation on my homepage by utilizing code from this source and making minor HTML edits to customize the content. https://codepen.io/hi-im-si/pen/DHoup. <h5> <body>Hello! I am Jane.</body> < ...

"Implementing a feature to dynamically load Blogspot post content using JSON upon user

$.ajax({ url: 'https://uniquewebsite.com/feeds/posts/default?start-index=1&max-results=2&alt=json-in-script', type: 'get', dataType: "jsonp", success: function(data) { var entry = data.feed.entry; ...

Is there a way to divide a single array into two separate arrays based on a specific element?

My goal is to create an interactive graph using plotly.js. I have an array named data that contains all the information needed for the graph. However, I want users to be able to select specific elements to display on the graph. To achieve this functionalit ...

Utilize jQuery to initiate an AJAX request based on the data retrieved from a previous AJAX call, then retrieve the resulting array

When the page loads, I initiate an ajax call and receive an array in response. For each element with the name groupId in this array, I must make another ajax call to fetch the group's name and notes. My objective is to create a final array by combini ...

The height of the div element is automatically adjusted to zero

I am dealing with a simple layout where I have a main div that floats to the left. Within this main div, I nest other divs using the clear both style. Below is a simplified version of my setup: <div id="wrapper" class="floatLeft"> <div id="ma ...

NPM is currently malfunctioning following an update

After successfully installing a new package from NPM, I received the standard notification that an update was available: + <a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="3c4e5958554f115f5351515d5258594e7c0c120b">[email prote ...

Having trouble importing DropDown and MenuButton components from materialUI Joy

As I attempt to create a simple menu dropdown using Dropdown and MenuButton from the MaterialUI Joy library, I encountered an issue. After installing the library, I could not locate the DropDown and MenuButton folders within the 'joy' directory i ...

Encountered an error: Unable to locate the variable 'window' in suds.js

I have been experimenting with receiving SOAP responses in a mobile application I am developing using Titanium Studio (version 2.1.1). I have integrated the suds library for this purpose, but when I make the call, I encounter an error [WARN] Exception in ...

What is the significance of using a double arrow function in Javascript?

Can someone explain the double arrow notation used in the code snippet below? How does the second arrow function get executed if the first one's response is true? And in what scenarios is this notation typically used? async check({ commit }) { ...

Generating HTML Tables Using PHP Arrays

Is there a recommended approach for creating a table in PHP that mimics the structure of an iOS table view or an Android ArrayList? I am looking to implement a functionality where a row can be selected and the value from that row can be retrieved, similar ...

Issue with unrecognized expression in JQuery when processing Ajax response

Recently, I implemented a JQuery Ajax Form on my website. $('#modal-body-sign-in').on('submit', '#sign-in', function(e) { e.preventDefault(); var data = $(this).serialize(); var url = $(this).attr(&apo ...