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.

Having trouble with integrating @rneui or react-native-vector-icons in React Native projects? You're not alone - many users have reported errors and project breakages

I have recently delved into the world of react native, although I am well-versed in other programming languages. My projects seem to be plagued by an abundance of errors, especially when it comes to installing new packages. While I have managed to workarou ...

React Native ScrollView ref issue resolved successfully

I'm trying to automatically scroll to the bottom of a flatlist, so here's what I have: const scrollViewRef = useRef(); //my scroll view <ScrollView ref={scrollViewRef} onContentSizeChange={() => { scrollViewRef.current.scrollToEnd({ ...

What is preventing the nativeEvent callback from being triggered in React Native's Animated.event() function?

Why isn't the nativeEvent callback triggering in my Animated.event call when dragging a box? I am working on implementing functionality to prevent draggable components from going off-screen using gesture control. However, I'm facing an issue whe ...

Using either Google Maps or a customized mapping solution in a React Native application

I am currently developing an application that allows users to input addresses and locate them on a map. I am wondering if implementing AI technology or utilizing specific libraries is necessary in order for this feature to function properly within a reac ...

Attempted to register two components under the identical name RTCVideoView in React Native

https://i.stack.imgur.com/un7Mx.jpg Encountering an error while trying to run my app on Android, unsure of the cause or how to resolve it. Despite trying multiple solutions, I haven't been able to fix the issue. Error Message: Tried To register two Views ...

Modify the directory (app) within the Next.js app router

Hey there, I am looking to change the default app-router folder (app) in Nextjs I have tried searching for a solution but couldn't find one I want to rename it from: src/app/layout.tsx to src/nextapp/layout.tsx Does anyone know how to do this? I'd appre ...

When Typescript and React Native Imports Clash in an Express App, Resolving the Conflict of "npm run build" Command

When running my Express app using 'npm run serve', defined as 'npm run build && node lib/index.js' in the package.json scripts serve section, I encounter multiple duplicate declaration errors after installing React Native for a separate project: h ...

There was a dependency issue that caused the task ':react-native-camera:compileDebugJavaWithJavac' to fail

I'm encountering difficulties while trying to run an older project. I will update it once I am able to successfully open it. Whenever I use ./gradlew build, I receive this message: https://i.stack.imgur.com/tYinI.png This is the content of my build.grad ...

Is it possible to modify styling programmatically in a React Native application?

I was wondering if it is achievable in react native to assign a style to a variable that relies on the response of an API call? For instance let textColor = 'fake-api-getcolor' <text style={{color: textColor}}>Hello</text> Then, link that ...

Encountering an error in React Native: When importing the 'localized-strings' object, it throws an "Undefined is not an

I'm currently facing a challenge in React Native and JS, as I am struggling with importing a function from another file and passing it. I am utilizing the 'localized-strings' library available at this website. Below is my code snippet where ...

How can you activate a prop in react native based on a certain condition?

To add a border to a native base button only if the menu index is equal to the house menu, use prop bordered. <Button bordered> <Text uppercase={false}>House</Text> </Button> My attempt: <Button {menuIndex == menus.house? ...

Testing for detox: SyntaxError - there is an absent initializer in declaring a constant

Recently started working with React Native and Detox, but encountering challenges in debugging the root cause of an issue. Our test environment initiates by running the docker using npm run e2e -- --docker start The script 'e2e' defined in pack ...

I'm trying to figure out which specific versions of node, react-native, expo, firebase, etc. to install in order to avoid any potential dependency issues

I am a novice in the world of development. What is the best approach to tackle the dependency versioning issue? Are there guidelines on which versions can be compatible with specific node versions? Your advice on this matter would be greatly appreciated! ...

Experiencing an excessive number of re-renders can be a common issue in React as it has limitations set in place to prevent infinite loops. This

I have integrated React context to access the login function and error from the context provider file for logging into the firebase database. I am trying to display any thrown errors in the app during the login process. However, I encountered an issue whe ...

Error Encountered: SyntaxError due to an Unexpected token < found in JSON at position 0

I am struggling to retrieve data from a local asp.net API running on https://localhost:44388/. When attempting to make a GET request, it returns HTML instead of JSON. There are two possible reasons for this issue: 1. Typo in the URL (I have verified in m ...

Error: The getter callback for the component `RNCSafeAreaProvider` must be a function, but it is currently undefined

After attempting to update my React Native app's dependencies using npm update, chaos ensued. To rectify the situation, I reverted back to the previous package-lock.json, deleted the node_modules folder, and re-ran npm i. Surprisingly, instead of res ...

Leveraging React Native to position a view absolutely in the center of the screen without obstructing any other components

How can I center an image inside a view in the middle of the screen using position: "absolute"? The issue is that the view takes up 100% of the width and height of the screen, causing all components underneath it (such as input fields and buttons ...

Installation of the Create React Native app was unsuccessful

After hearing about Create React Native App being the simplest way to start a new React Native application, I decided to install it. However, my attempt was unsuccessful. My Node version is v8.10.0 and npm version is v4.2.0. I encountered an error which h ...

I am experiencing difficulty with aligning my input boxes to the center in my React-Native

Just a heads up, this is my first time diving into the world of React Native, so bear with me as I try to figure things out. Please be kind if my question seems silly... Here's a snapshot of what I currently have: https://i.stack.imgur.com/VWGFm.png ...

Creating seamless transitions between pages using hyperlinks

On the homepage, there are cards that list various policies with a "details" button above them. Clicking on this button should take me to the specific details page for that policy. However, each product can only have one type assigned to it. For instance: ...

Exploring the Power of Apollo Queries in React Native

After reading through this blog post on integrating query components with Apollo (), I learned how to pass a function from a child component to its parent so that it can be called with the correct parameters. Despite following the instructions, I keep enc ...

Is there a way to alter the format of a URL?

I'm utilizing the ytdl-core library to access a URL for audio content. The provided URL is: https://r2---sn-gwpa-w5py.googlevideo.com/videoplayback?expire=1612552132&ei=ZEMdYNnJDumPz7sPyrSLmAw&ip=49.36.246.217&id=o-AFQLS1cSUJ6_bXBjMOIiWk1NuIYTM ...

Tailwind - Error: the function is undefined

Just beginning my journey with React Native and facing this error. Screenshot of IOS App emulator Screenshot of Terminal import React from "react"; import { StyleSheet, Text, View } from 'react-native'; import tw from "tailwind-rn& ...

Struggling with a React Native build warning problem?

Upon executing react-native init reactApp, I encountered a warning stating that npm WARN <a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="9ceef9fdffe8b1f2fde8f5eaf9dcacb2afa5b2ae">[email protected]</a> requires a pe ...

What is the reason behind receiving an undefined error?

I am looking to implement the setLoading function from the "Screen" component into the "HomeScreen" component. Here is how it can be achieved: context.js import { createContext } from "react"; export const LoadingContext = createContext(); screen.js The ...

I am looking to export multiple 'Pure components'

Currently, I am developing an app using React Native and came across an unusual observation. For some reason, the following code throws an error unless I modify the last sentence to: export default MyButton3; I aim to export more than one pure component ...

Encountering a module resolution issue when upgrading react-native-calendars from version 1.222.0 to 1.1274.0, specifically with the ../../../component-updater module

I am currently in the process of updating the react-native-calendar package from version 0.222.1 to the newest version, 0.1274.1, within my react-native project. link to versions Initially, in v1.222.0, the file was identified as react-native-calendars/sr ...

react-native-iap is constantly returning an empty array when trying to fetch subscriptions

I am currently utilizing react-native-iap for in-app purchases. However, I am encountering an issue where the getSubscriptions function is returning an empty array when used on Android. Interestingly, everything works as expected on iOS. Despite my best e ...

Uncovering the secrets: accessing hidden folder files in react-native-fs

I am encountering a problem when trying to access files from a hidden folder /WhatsApp/Media/.Statuses in react-native-fs. Despite granting the READ_EXTERNAL_STORAGE permission on Android, I only receive an empty array when attempting to access it using th ...

What is the best way to convert an array of data into a dataset format in React Native?

Within my specific use case, I am seeking to reform the array structure prior to loading it into a line chart. In this context, the props received are as follows: const data = [26.727, 26.952, 12.132, 25.933, 12.151, 28.492, 12.134, 26.191] The objective ...

Error: Unable to execute setState in React Native

Why am I receiving an error stating that this.setState is not a function? I'm having trouble understanding why my code isn't working as expected. import React from 'react'; import axios from 'axios' import { StyleSheet, Text, View , Image} from 'react-na ...

Index.js is dynamically importing a .tsx file post-build, with a specific focus on Windows

While working on my project, I decided to customize a module by cloning it and making some changes. After installing the dependencies and building it, I encountered an error when trying to run it. The error message stated: Error: Unable to resolve module ' ...

Developing the headers for a service using React.js

As someone new to ReactJs, I'm curious about the various methods we can use to include Headers in our service Url before making a call. While I'm familiar with how GET/POST Calls are made in angular Js after including headers, I'd like to l ...

Exploring design techniques in React Native

I am currently part of a team working on a react native project with multiple contributors. My goal is to find an effective way to segregate the styling tasks from coding, allowing UI developers to work independently without relying on code developers. In ...

Enhance your React Native app: Utilizing dynamic string variables with react-native-google-places-autocomplete query

I have encountered an issue while attempting to pass a dynamic country code to restrict search results. Here is the code in question: let loc = 'de' <GooglePlacesAutocomplete placeholder="Search" autoFocus={true} onPress={(data, d ...

Unable to replicate the function

When attempting to replicate a function, I encountered a RootNavigator error Error in duplicate function implementation.ts(2393) I tried adding an export at the top but it didn't resolve the issue export {} Link to React Navigation options documen ...

What is the best method for transitioning to a new page in React Native using Ignite Bowser?

Recently I ventured into the world of React Native with Ignite Bowser. My current project involves building a React Native app using Ignite Bowser. At the start of my app, there's a welcoming screen that pops up. It features a 'continue' button which, whe ...

What is the best way to retrieve the Json data in React Native as indicated in the following example?

The data in JSON format follows a specific pattern. This JSON data is received from the backend through an API call and stored in a state variable. { "message": "user created successfully", "status": "success", "student": { "class": "1 ...

Is there a way to display an image in a React Native app using data from a JSON file?

I am currently working with JSON content that includes the path of an image. I need to display this image in my React Native application. What is the best way to render this image? {"aImages":[{"obra_path":"http:\/\/uploa ...

Adjust the color of the entire modal

I'm working with a react native modal and encountering an issue where the backgroundColor I apply is only showing at the top of the modal. How can I ensure that the color fills the entire modal view? Any suggestions on how to fix this problem and mak ...

I'm currently working with React Native and Node.js, but I'm encountering an issue where I can't seem to successfully navigate between screens after receiving a response from

This function is called when the login button is clicked: login=()=>{ fetch('http://192.168.0.101:9090/Shakehands',{ method:'post', headers:{ 'Accept':'application/json', 'Content-type':'application/json', ...

The getAriaValueText function in Material UI's Slider component is not functioning as expected

Experience the live example here This code snippet is directly sourced from the official material ui website. <Slider defaultValue={80} // getAriaValueText={valuetext} aria-labelledby="discrete-slider-always" ...

Issue with passing props to screen not displaying on initial load

Greetings, I'm a newcomer to the world of react native and currently facing an issue: const Tab = createMaterialTopTabNavigator(); export const CurriculumMenu = ({navigation, item}) => { const data = item.Title; console.log(data) return ( ...

React Native: Issue with componentWillUpdate not being triggered

In my current project, I am developing a React Native app that utilizes both React Navigation and Redux. class LoginScreen extends Component { state = { email: '', password: '', errors: { email: '', password: '' } } onPr ...

Having trouble loading the script from the assets 'index.android.bundle'? Ensure that your bundle is properly packaged or that you have a packager server running

I encountered an issue while updating my React Native application from version 0.38.0 to 0.45.1. The error message I received is as follows: java.lang.RuntimeException: Unable to load script from assets 'index.android.bundle'. Make sure your bun ...

Issue encountered when executing 'react-native link': 'Dependency not recognized'

I'm currently working on developing a video chat feature for my project, following this example: To kickstart the project, I created a new one using: npx react-native init AwesomeProject Next, I added the necessary dependencies: npm install --save ...

Error: Trying to destructure a non-iterable object with useContext in React is not valid

ERROR [TypeError: Invalid attempt to destructure non-iterable instance. In order to be iterable, non-array objects must have a Symbol.iterator method.] Using UserContext : import React, { useContext, useEffect, useLayoutEffect, useState } from "reac ...

Discovered a total of 11 minor vulnerabilities within a React Native Project

Every time I start a new React Native project using react-native init <projname>, and then attempt to install any necessary NPM Package, I always encounter this issue - identified 11 low severity vulnerabilities How can I resolve this problem? ...

There seems to be a problem with installing JavaScript dependencies in RN Expo. Please review your npm logs for more information. The app initialization process will

Having an issue with building a new app using react native and Expo. Whenever I run expo init appName, I encounter the following error message: ...

Saving flatlist item data upon pressing in a React Native app

Recently delving into the world of react native, I am eager to learn how to save the items from the flatlist upon pressing them and then showcasing them. Initially, I incorporated an Autocomplete view for selecting countries and subsequently exhibiting the ...

Having trouble getting Expo CLI to install properly?

Struggling to install expo on my new Windows 10 PC even after installing node. When I run the command npm install --global expo-cli, CMD says that expo is not recognized as a command. I tried running it as an admin and using PowerShell, but nothing worked. ...

Having encountered peculiar behavior while trying to install npm

When attempting to install npm packages in my React Native project and running npm install, I am encountering an issue where the packages are installed with random strings appended. This unexpected behavior is causing my project to break. For example, I ...

When using React-Native, attempting to utilize the drawer open feature from the stack navigator within the header back button

I am a beginner in the world of react native and I am trying to figure out how to access the drawer open feature on my home page from stack navigation, specifically within the launch.js file. launch.js import * as React from 'react'; import {Button, Vie ...

React Native ScrollView with a custom footer that adjusts its size based on the content inside (

I've implemented the code below to ensure that the blue area in image 1 remains non-scrollable when there is sufficient space, but becomes scrollable when space is limited. However, I'm facing an issue where the ScrollView component is adding extra spacing ...

Expo does not support playing audio files from assets

import AlphService from './AlphService'; export default class MyClass extends React.Component { alphService; constructor(props) { super(props); alphService = new AlphService(); this.state = alphService.getState(); } componentWillMount( ...

Substitute this.bindMethod for function component

I have a class component that is structured like this: interface MyProps { addingCoord: any resetCoords: any } interface MyState { x: any y: any } class DrawerOld extends React.Component<MyProps, MyState> { width: number height: number ...

iOS compatibility issue preventing React Native app from functioning

Hey there, I recently downloaded a sample app from https://github.com/iZaL/my-appointment. However, when I try to run it, I encounter an error in my-appointment-master/src/containers/Category/Category.js: It says "Unable to find this module in its module m ...

What is the method for typing an array of objects retrieved from realmDB?

Issue: Argument type 'Results<Courses[] & Object>' cannot be assigned to the parameter type 'SetStateAction<Courses[]>'. Type 'Results<Courses[] & Object>' lacks properties such as pop, push, reverse, and shift that are present ...

Ways to display a screen only once in React Native

Is there a way to display the first screen to users only once, when they first open the app (like a welcome screen), and then show them the second screen on subsequent openings? Snippet from App.js: import React from "react"; import "react- ...

Performing an Axios POST request in a React Native and React app using JSON.stringify and Blob functionality

I am currently developing an application where I have encountered an issue when calling an API endpoint in react native. Interestingly, the web app (built with React) does not encounter any errors. Here is the code for the web app using React with TypeScri ...

Interactive map navigation feature using React.js

Can someone help me figure out how to create a dynamic map with directions/routes? I am currently using the Directions Renderer plugin, but it only shows a static example. I want to generate a route based on user input. Below is the code snippet: /* ...

Retrieve highlighted text along with its corresponding tag in ReactJS

my <span class="highlight">highlighted</span> word The text above is showing an example including HTML tags. However, when using window.getSelection(), only the text "my highlighted word" is returned without the surrounding <span& ...

Having trouble executing a React Native project because of react-native-gesture-handler

After adding react-navigation and react-native-gesture-handler to my project, I encountered an error when running it with react-native run-android: What's the issue: Could not compile settings file 'C:\Users\pc\Desktop\GST ...

Using custom input with Formik in React: A comprehensive guide

Currently, I am attempting to integrate the DatePicker component into Formik. However, upon clicking on a date in the DatePicker, the form value does not get updated. Instead, an error occurs: Uncaught TypeError: e.persist is not a function at Formik. ...

The component `style` requires a callback function as a getter for its configuration, but `undefined` was received instead. Remember to always capitalize component names at the beginning

When working with the MUI library in React Native, I encountered an issue: ERROR Invariant Violation: View config getter callback for component style must be a function (received undefined). Make sure to start component names with a capital letter. I ha ...

Updating the appearance of tabs in React Native Navigation dynamically during runtime

I am currently working with the startTabBasedApp API, which includes three tabs in my app. I have a requirement to change the background color of the tabBar for specific screens dynamically. Is it possible to achieve this at runtime? For instance: Scree ...

Type of Data for Material UI's Selection Component

In my code, I am utilizing Material UI's Select component, which functions as a drop-down menu. Here is an example of how I am using it: const [criteria, setCriteria] = useState(''); ... let ShowUsers = () => { console.log('Working criteria', type ...

How to Set a Button as Inline Text in a React Native Component

Below is the code snippet I am working with utilizing the Text and Button components provided by react-native-paper: <Text>See also </Text> <Button mode="text" compact onPress={this.nav( name )}>Compass</Button> <Text&g ...

"Experience the seamless navigation features of React Navigation V6 in conjunction with

Hello there, I've been experimenting with react-navigation 6 in an attempt to show a modal with presentation: "modal" as instructed on the documentation. However, I'm facing an issue where the modal is not displaying correctly and appears like a regular ...

Guide on installing React packages during runtime

My React project has a number of packages that need to be installed, but they take up a lot of disk space. I would like to install them only when necessary, after the user interacts with a specific component that requires these packages. Is there a way t ...

Snapshots testing app Expo TypeScript Tabs App.tsx

After setting up an Expo project with Typescript and Tabs, I decided to add unit testing using Jest but ran into some issues. If you want to create a similar setup, check out the instructions here: . Make sure to choose the Typescript with Tabs option whe ...

What is the best way to update multiple state objects and send them to another component in React?

I am a newcomer to react-native and have been struggling to retrieve arrays of JSON data from openweathermap's API. I have tried various methods but nothing seems to work. Any suggestions or guidance would be greatly appreciated. I have managed to fetch th ...

Utilizing React Native for Seamless Navigation: Understanding Stack and Tab Navigation (Ensuring the route component is a React component)

Attempting to create a StackNavigator that can navigate into a TabNavigator, but encountering an error stating: "The component for route must be a React component." The TabNav is not a physical file folder; it is intended to be called once the user logs i ...

Encountering a command line issue while attempting to set up a new react

Embarking on my first react-native project, I decided to set up a demo project to get the hang of react-native. Unfortunately, I encountered an issue while trying to create a project via the command line. Following the installation of necessary libraries, ...

Creating a Search Bar Component with React Native

I am attempting to integrate a searchbar from react-native-searchbar into my application in order to filter a list. However, I am encountering an error that states: "deputies is not defined." As a beginner in React Native, I am unsure about how to proc ...