Questions tagged [react-native]

React Native is a groundbreaking JavaScript framework designed to empower developers in creating cross-platform mobile applications using the power of React. With React Native, you can harness the full potential of your skills and effortlessly develop apps that seamlessly adapt to various platforms, allowing you to learn just once and write your code anywhere with utmost efficiency.

Tips for accessing multiple JSON responses from an array in React Native

Typically, in React Native, I would access the JSON response using responseJson, but how can I access more than one response? The JSON is encoded here in php: Login.php if ($row = mysqli_fetch_array($result)) { $allresults = array( 'Data Matched' = ...

React Native Elements Overlay: Troubleshooting Webview Functionality

I've implemented react-native-element for the components in my app and I'm using Overlay to display modals. However, I encountered an issue with displaying a WebView within one of the modals. export const Modal = ({ visible, showCrossBtn, se ...

Trigger a component update by clicking on it

I am currently working on a feature that involves displaying a new string on the page whenever a button is clicked. I have set up a service that returns the desired string when the button is tapped, and this part is functioning correctly as I can log and a ...

Activate the overflow feature within native-base cards

I have a unique design element on a website that showcases an image overflowing off a card. The image has a negative margin-top of -50, creating this effect. Now I'm trying to replicate this design in react-native using native-base components. Here i ...

Discover the secret to prompting iOS 12 Autofill to request password saving within a React Native application

ISSUE I am currently using React Native 0.59.9 and have implemented a login screen in my mobile app with the intention of utilizing iOS 12's autofill feature to save passwords for new users. However, despite setting up the necessary configuration, th ...

Initiate the React project by executing the command to start React Native development

Typically, I start my projects using npm start, but one time I accidentally ran npx react-native start and all the installation process for React Native completed. Now, I'm not sure if I need to worry about this or if I should remove React Native. If ...

Position the buttons in the react children's application

**Looking for help on positioning Black Widow in the center-left and Hulk at the bottom left of the screen. I'm having trouble figuring it out, does anyone have any tips? Also, I only want to isolate the buttons to each picture. Not sure if I need to separ ...

Error 500 encountered while trying to send a "multipart form-data" POST request in React Native

Every time I attempt to send an image POST request to my Node/Express server hosted on Heroku, a 500 server error occurs. Strangely enough, using Postman for the POST request works perfectly fine. This is the React Native code I am using: upload = async ...

React Native Child Component State Update Issue

In my code, there is a Child component that triggers a function in the Parent component. However, when the function is triggered, an error related to the setState method is thrown. Issue with Promise Rejection (id: 0): The '_this12.setState' i ...

Issue encountered while installing a package with "n low-risk vulnerabilities"

Just set up a new react-native project on big-sur. Encountered an error while trying to install an npm package. How can I resolve this? npm install @react-navigation/native up to date, audited 1026 packages in 2s 6 low severity vulnerabilities To addr ...

Deliver JSX components that match one or more keys in the array of strings

Seeking assistance and guidance here. It seems like I might be overlooking something obvious. I am attempting to create a component that accepts either a string or string Array string[] as a property. const ComponentThatReturnsElement = (someElementName) = ...

Issue: bundling process failed. Error message is "SyntaxError in C:/Program Files/reactt/albums/index.android.js: An unexpected token found, expected a semicolon (6:8)"

Below is a code snippet that I currently have: import React from 'react'; import { Text, AppRegistry } from 'react-native'; const App = () => ( <Text>Wow, This is Amazing</Text> ); AppRegistry.registerComponent('albums', () => Ap ...

Tips on hiding bottom tabs when navigating to a route that is two levels deep

When a specific screen is active, I want the bottom tab bar to disappear. Using react navigation for this purpose. For example, when the "Insight Detail Adjustment" screen is displayed, I need the bottom tabs to be hidden. Currently, none of the solutions ...

What methods can be used to verify the compatibility of an npm package with react-native?

Is it possible to check if an npm package is compatible with react-native? I have heard that for a package to be compatible with react-native, it must have a polyfill. Is there a way to verify this? Take the package redux-persist, for example. As I cont ...

What is the best way to customize the renderItem method in React Native's SectionList to be based on sections instead of

I've been exploring the FB docs and came across a mention of being able to override the default item-based renderItem method with a section-based render in the SectionList component in React Native. However, I'm struggling to find a way to actually impleme ...

Enhancing performance with React.memo and TypeScript

I am currently developing a react native application. I am using the Item component within a flatlist to display data, however, I encountered an error in the editor regarding the second parameter of React.memo: The error message reads: 'Type 'bo ...

Using Stack and Drawer Navigations Together in React Native Navigation(v6)

I am looking to merge Stack and Drawer navigations. I have multiple screens and wish to display select screen labels in the drawer tab. <RootNavigatorStack.Navigator> <RootNavigatorStack.Screen name="DrawerTab" component={DrawerNavig ...

What could be causing my Alert component to keep triggering repeatedly?

This is my custom React Native script. import React, { useState, useEffect } from 'react'; import { Alert, View, Image, StyleSheet, Animated, Easing, TouchableOpacity, Text, ScrollView, ImageBackground, Dimensions, TextInput } from 'react-native'; import * ...

What is the best way to toggle visibility of individual items based on their title in a react native application

I desire this result: when I click on the header for the letter "A", only data corresponding to the letter "A" should be hidden when I click on the header for the letter "A", only data corresponding to the letter "A" should be shown when I click on the ...

"Dealing with Cross-Site Request Forgery in React Native and Django

After updating my React Native version from 0.67.0 to 0.72.6, I'm still utilizing Django 3.1.2 for my backend system. For handling sessions, I am using the default method provided by Django. Currently, I have a CSRF token stored in Asynchronous storage wit ...

Unable to continue due to being stuck in the "Starting packager" phase of React Native development

Whenever I attempt to start the React Native project (you can find it here), the npm start script gets stuck on Starting packager I have already checked these resources regarding the issue: react-community issue: 203 react-native-stuck-at-starting-packa ...

Encountered a problem while setting up React app using npm

I've encountered an issue while trying to install a react app using npm. Even after downgrading my npm version to 3, I am still facing errors. My internet connection is strong as well. Thank you in advance for your assistance! https://i.stack.imgur ...

React Native: Enhance the background with a vibrant stripe of color

I am trying to incorporate a strip of grey in the middle of my white background, but I am encountering an issue where I am unable to input any text inside it. Below is the code snippet I am working with: container: { flex: 1, justifyContent: "cent ...

Sorting information in the React Native Section List

Working with React Native's SectionList and filtering data: data: [ { title: "Asia", data: ["Taj Mahal", "Great Wall of China", "Petra"] }, { title: "South America", data: ["Machu Picchu", "Christ the Redeemer", "Chiche ...

What is the best way to change function.bind(this) to an arrow function in a react native application?

I am attempting to convert my function into an arrow function, but I keep encountering an error of undefined when passing props. <TextInput style={styles.input} value={formState.inputValues.title} onChangeText={textCh ...

Expo Google Mobile Ads for React Native

My application was running smoothly on expo until I decided to incorporate the 'react-native-google-mobile-ads' package. Since then, I have been bombarded with constant errors despite having gone through all configurations thoroughly. Expo SDK 0.48 React ...

Apple StoreKit API Integration in React Native (ExternalLinkAccount)

Recently, I submitted my "reader" app to the app store and encountered an issue with ExternalLinkAccount after the IOS 16 update. Apple now mandates the use of the `open()` method instead of creating a custom modal component. Is there a way to call the `op ...

Customize the color of a specific day in the MUI DatePicker

Has anyone successfully added events to the MUI DatePicker? Or does anyone know how to change the background color of a selected day, maybe even add a birthday event to the selected day? https://i.stack.imgur.com/or5mhm.png https://i.stack.imgur.com/so6Bu ...

Bundling was unsuccessful for modules that are not utilized

Upon transitioning from my Windows laptop with Visual Studio Code to my Ubuntu setup with Visual Studio Code, I encountered some strange errors related to bundling modules that are not even used in my application. One specific error message is as follows ...

Error: The JS Exception has not been handled, as it is stating that 'undefined' is not an object when evaluating 'global.performance.now' in react-native-tvOS

I am currently working on a React-Native-tvOs app and despite following all the instructions from the react-native-tvOs GitHub page, I keep encountering an error when running the default template app. Even after running the script provided on the GitHub re ...

Methods for invoking a function from a separate .js file within React Native Expo

I'm new to using React and I've come across a challenge: In my Main.js file, there is a button: import * as React from 'react'; import { StyleSheet, Text, View, SafeAreaView, Pressable, Alert } from 'react-native'; import { MaterialIcons, MaterialCommunit ...

The react-xml-parser package is asking for Babel version "^7.0.0-0", however it was instead loaded with version "6.26.3". I have already attempted all available solutions to resolve this issue

I have attempted numerous solutions from the Github community regarding this issue, but unfortunately none have worked for me. /node_modules/react-xml-parser/dist/bundle.js: Requires Babel "^7.0.0-0", but was loaded with "6.26.3". If you are sure you ha ...

Creating a React Native project without the use of TypeScript

Recently I dived into the world of React Native and decided to start a project using React Native CLI. However, I was surprised to find out that it uses TypeScript by default. Is there a way for me to create a project using React Native CLI without TypeS ...

The button's corners did not appear rounded after setting the borderRadius to '50%' in iOS

Does the same code round off buttons properly in Android but not in iOS? Is the percentage value not compatible with the iOS platform in React? import { TouchableOpacity, Text } from 'react-native'; export default class App extends React.Component { r ...

MQTT: The method net.createConnection does not exist

Following the guide at https://www.npmjs.com/package/mqtt#install to establish an mqtt connection, I encountered a render error indicating _$$_REQUIRE_(dependencyMap[1], "net").createConnection(port, host)','_$$_REQUIRE(_dependencyMap[1], " ...

Visual Editor for React Material UI - A Unique Designing Experience

I've launched a new open-source project focused on creating a visual editor specifically for React Material UI. If you're interested, feel free to check out the project link. The idea behind this project is to allow users to easily drag and drop ...

I am looking to transfer information to a different screen using FlatList in React Native

Hey everyone, I'm new to React Native and I'm trying to create a news app with posts. I'm having trouble figuring out how to pass data in a flatlist to another screen and open the screen with the post data. I'm using V6 navigation. Here ...

Learn how to implement AuthContext and createDataContext in React Native Expo development using TypeScript

AuthContext.tsx import createDataContext from './createDataContext'; import serverApi from '../api/server'; const authReducer = ({state, action}: any) => { switch(action.type){ default: return state; } }; const signup = () ...

Steps to create a full screen notification similar to WhatsApp call on React Native Android platform

Currently, I am working on integrating a notification system that can display full-screen notifications, even on the lock screen similar to a WhatsApp call using React Native for Android and OneSignal. Unfortunately, I have been unable to find a reliable ...

Upon reacting with Typescript, the window will transition to the homePage, however, it will also reset

Trying to redirect this component to the HomePage</code causes the data to restart once it reaches the home page.</p> <p>Any recommendations for an alternative to <code>window.location.href = "/HomePage"? import React, { useE ...

Discovering the magic of nesting maps in React-Native without the need for

I am currently developing a react-native app that retrieves its data through an API. I am working on implementing a new feature where the information is grouped by date. The JSON data structure sent by the API looks like this: { "channel_count" ...

Mapping objects in an array with Javascript

This code snippet is intended for a React Native Chat app. The structure of my data should look something like this: const chatData = [ { id: 1, name: 'John Doe', messages: [ {text: 'Hello', sentAt: 'time here' ...

Implementing push notifications as a standalone feature in React Native

As I work on developing a React Native application, my goal is to create an npm package for FCM Notifications. This would allow me to easily incorporate the functionality into any project by simply providing the necessary information to the package, such a ...

I am facing an issue where using JSON stringify in React Native successfully returns my array, but it is unable to display

Every time I input {alert(JSON.stringify(cart[0]))} in my react-native application, the result displayed is the complete array of objects as shown below: [{ "id": 3, "name": John, . . }] However, when I try {alert(JSON.stringif ...

The error message "Unable to access characteristics of the object (specifically, the 'transformFile' property) due to it being undefined

After updating my node today, I encountered the following error: error: TypeError: Cannot read properties of undefined (reading 'transformFile') at Bundler.transformFile (/Users/.../node_modules/metro/src/Bundler.js:48:30) at runMicrotasks (<ano ...

Execute GTmetrix report retrieval using React Native

Attempting to access GTmetrix report using react native. I am struggling with react native development, any assistance would be greatly appreciated. Code: constructor(props){ super(props); this.state={ isLoading:true, dataSource:nu ...

Error message received when making an API call in React Native for Android and saving the response to a local database: 'Error: Network

Despite using axios and promises to make a call to a local database API, I am facing difficulties reaching the endpoint as I constantly receive a 'Error: Network Error' feedback in the console without any further explanation on the root cause of ...

Error with Typescript types when using Styled Components

After successfully setting up styled-components in react-native, I encountered an issue while trying to use it in a simple example with react-native-web: import * as React from 'react'; import styled from 'styled-components'; export d ...

A guide to integrating Social Login APIs (Google, Facebook, Apple) with NodeJs Express REST for a React Native application

Would it be possible to integrate Social Login APIs from Google, Facebook, and Apple with a React Native App using NodeJs Express REST? Can this implementation follow a similar process as it does for web applications? How would you go about creating the ...

What could be causing the issue with npm modules installation?

I've been having trouble installing the react-native-cli module, as well as any other module. Here's what I've tried: npm install -g react-native-cli When I run this command in the terminal, I keep getting an error. I've used node on Windows before and ...

Creating a visually appealing gantt chart in React Native using the react-google-charts library - here's how!

These are the current packages I am using: react-google-charts 1.5.5 react 16.0.0-beta.5 react-native https://github.com/expo/react-native/archive/sdk-22.0.1.tar.gz I am currently working on rendering a Gantt Chart and you can find an example here and a ...

What is the best way to include icons in a searchable toolbar using React Native Material Design?

I am currently working on a React Native app that utilizes material design, and I have integrated the react-native-material-ui package. However, I am facing an issue with adding certain icons to the searchable function on the toolbar. I would like to achi ...

Encountering an issue with inability to resolve the 'react-navigation-stack' module. Still seeking a solution to this problem

Having trouble with my react navigation in react native. I've already added npm react-navigation-stack and also npm install --save react-native-gesture-handler react-native-reanimated react-native-screens. The error message I'm getting is: Unab ...

the <MapView/> component in react-native-maps cannot be displayed

I am attempting to display a native map using the coordinates from the example but encountering an error: *note using iOS and a real device for debugging ERROR: Could not inset compass from edges 9 Could not inset scale from edge Could not inset legal ...

Developing a react native library (create-react-native-library) incorporating a distinct react-native version within its designated Example directory

I'm looking to develop a React Native library, but the testing folder (example folder) it contains the latest version of React Native. However, I specifically need version 0.72.6 in the example folder. Is there a command for this? Current command: np ...

Caution: Potential Unresolved Promise Rejection Detected (ID: 21) - Error: Undefined is not a valid object when trying to evaluate 'res.json'

ERROR Getting an Unhandled Promise Rejection (id: 21): TypeError: undefined is not an object (evaluating 'res.json'). Any suggestions on fixing this issue in my code? I've checked the logs for user and loggeduserobj, and they seem to be cor ...

Background Design using React-Native SVG

I'm trying to incorporate an SVG background pattern in React-Native. My approach involved creating a Component using the 'react-native-svg' library, shown below: import React from "react"; import { SvgXml } from "react-native ...

Invoke the componentDidMount() method in a React Component that is not a subclass of React.Component

I have a react component that I render later in my index.js file index.js import React from 'react'; import ReactDOM from 'react-dom'; import App from './App'; ReactDOM.render( <React.StrictMode> <App /> ...

Type definitions in Typescript for the style property of Animated.View

One of my components has a Props interface that extends ViewProps from React Native, like this: export interface Props extends ViewProps { // Custom props } As a result, this also extends the style prop. However, I am facing an issue while using Animat ...

How do I include an icon on the far left of my NavBar menu? I'm having trouble figuring out how to add an icon to the header NavBar

How can I add an icon to the left of my NavBar header? I am struggling with adding an icon on the far left side of my NavBar. The NavBar is a custom class from NavBar.js. I want to include an icon in this bar on the leftmost side. I have already added b ...

Update a component variable externally

In my React Native project, I have a custom button component defined as: const CustomButton = ({ onPress, disabled }) => { let title = "submit"; return ( <TouchableOpacity onPress={onPress} disabled={disabled}> <View sty ...

Testing the attribute value of the React Material UI Drawer Component using Cypress

Looking at this MUI implementation inside my react component: <Box sx={{ display: 'flex' }}> <Drawer name="permDrawer" open={openSideDrawer} style={{ zIndex: -1000 }} variant="permane ...

Issue with ForwardRef component in Jest for React Native testing

When attempting to write a test case for my Post Detail screen, I encountered an error that stated: error occurred in the <ForwardRef> component: Here is my test class code: import React from "react"; import { NewPostScreenTemplate } from ...

Why is the console log not working on a library that has been imported into a different React component?

Within my 'some-library' project, I added a console.log("message from some library") statement in the 'some-component.js' file. However, when I import 'some-component' from 'some-library' after running uglifyjs with default settings, the message does not a ...

Troubleshooting: React Native Web Throws an Error When Using React Native Paper Provider and React Navigation NavigationContainer

As a newcomer to React-native and React-native-web, I find myself facing a challenge while working on an existing project. This project utilizes the React-Native-paper library and the @react-navigation/native library. Currently, I am attempting to adapt th ...

Adding objects at a specified position within an array using setWayPoints() rather than wayPoints.splice - a RecoilState approach

Currently, I am working with a recoil global State Array that contains Objects (Default: Start and Destination). I am looking to include Waypoints between them. When the green plus button is pressed, new Waypoints should appear: https://i.stack.imgur.com/ ...

Is MapView in React Native restricted to explicit markers only?

I'm facing a challenging problem while working on my app's mapview. I have been struggling to find a solution for dynamically repopulating the mapview. Initially, I attempted the following approach: render() { const dynamicMarker = (lat, long, title, de ...

Experiencing a dilemma with Watchman in React Native

To refresh the application, press "r" To access the developer menu, press "d" Received an error from jest-haste-map: Watchman crawl failed. Trying once more with node crawler. This typically occurs when watchman is not running. You can create an empty ` ...

Implementing reCaptcha on React Native: A Step-by-Step Guide

Currently, I am in the process of integrating a reCaptcha validator into a login screen for a react-native application that needs to function seamlessly on both web and mobile platforms. Despite being relatively new to programming and lacking experience w ...

Tips for enabling background scrolling when Popover is displayed: (React, React Native, Native-Base)

I'm utilizing the Popover component from NativeBase to design my popover: const SettingsButton: React.FC<Props> = () => { return ( <Popover trigger={(triggerProps) => { return ( ...

Issues are arising with the functionality of React-native link

After attempting to install and connect react-native sound in my project, I encountered an issue. When executing the following command within my project directory, react-native link react-native-sound the library fails to link and instead returns the fol ...

Using the useState hook to manage an array of boolean values in a React

As a beginner developer in React Native, I am facing a design pattern issue. I have multiple TouchableOpacity components in the same component and I need to maintain this structure. Each TouchableOpacity has an onPress function that changes its backgroun ...

I need help figuring out how to consistently place a button at the bottom of the screen. The button will be part of a component nested within a scrollview

Is it possible to always position a button at the bottom of the screen? This button will be part of a component within a scrollview. While absolute positioning works for keeping the button at the bottom, scrolling also causes the button to move along with ...

Integrating mandatory updates in React Native applications

Trying to find a method to prompt users to update a React Native app before proceeding. This is new territory for me, so any guidance on how to tackle this would be greatly appreciated! Thank you in advance for any insight. ...

Once more, objects cannot be used as a child element in React

I understand that there are similar questions about this topic, but I am struggling to approach it in a different way. I really need an array of objects to be inside a map. I have created an array to map it, but I need to find different information to disp ...