Skip to main content

Questions tagged [react-native]

React Native is a JavaScript library used to build native mobile apps using React. The focus of React Native is on developer efficiency across all the platforms you care about - learn once, write anywhere.

Filter by
Sorted by
Tagged with
106 votes
19 answers
142k views

TypeError: cli.init is not a function for react native

While running npx react-native init appName in MacBook air M1 chip TypeError: cli.init is not a function at run (/opt/homebrew/lib/node_modules/react-native-cli/index.js:302:7) at createProject (/opt/...
Bandish Kumar's user avatar
106 votes
9 answers
181k views

Creating CSS circles in react-native

I'm having some trouble creating CSS circles in react-native. The following works in iPhone 6 Plus but in all the other iPhones, they become diamonds. circle: { height: 30, width: 30, ...
cgarvis's user avatar
  • 1,146
105 votes
9 answers
146k views

React-native: How to control what keyboard pushes up

The structure of the app is fairly simple: A searchbar, a listview and react-native-tabs at the bottom. The problem: If I click on the searchbar on Android it pushes the whole app up, so I see the ...
dv3's user avatar
  • 4,529
105 votes
32 answers
171k views

Invariant Violation: requireNativeComponent: "RNSScreen" was not found in the UIManager

I am getting RNSScreen error even though I have installed all related packages and followed react-navigation guide (https://reactnavigation.org/docs/getting-started#installation) but nothing worked ...
Amit Agrawal's user avatar
  • 1,229
104 votes
37 answers
336k views

react-native :app:installDebug FAILED

Install APK debug to my device failed. jianglinghuadeMacBook-Pro:hello jianglinghua$ react-native run-android JS server already running. Building and installing the app on the device (cd android &...
江玲华's user avatar
  • 1,041
104 votes
40 answers
135k views

React native: Android project not found. Maybe run react-native android first?

I had an issue in my React-Native project which was working fine earlier but suddenly it stopped working. Whenever I used the command: react-native run-android I was getting an error: Android ...
udai's user avatar
  • 3,781
104 votes
18 answers
53k views

Get rid of "Remote debugger is in a background tab" warning in React Native

I've started a new React Native project and I keep getting the following warning: Remote debugger is in a background tab which may cause apps to perform slowly. Fix this by foregrounding the tab (...
mxmtsk's user avatar
  • 4,575
103 votes
22 answers
158k views

Auto scale image height with React Native

In my React Native app, I am fetching images from an API with unknown dimensions. How do I auto scale the height if I know my desired width? Example: I set the width to Dimensions.get('window')....
Phil Mok's user avatar
  • 3,970
102 votes
30 answers
175k views

Unrecognized font family on iOS simulator with React Native

I've added Linux Biolinum fonts (http://www.dafont.com/linux-biolinum.font, LinBiolinum_R.ttf, LinBiolinum_RB.ttf) to my React Native project. Android version is OK. But on iOS I always see error "...
valerybodak's user avatar
  • 4,343
102 votes
21 answers
204k views

React navigation goBack() and update parent state

I've a page that will render the user's name if s/he is logged in or "Create an account" or "Sign in" option if s/he not. Screen as below They can navigate to "Sign in" or "Create an account" page. ...
Darren Lau's user avatar
  • 2,035
102 votes
18 answers
168k views

Maintain aspect ratio of image with full width in React Native

I have a query regarding tag. I want an image to take entire width of parent which I do using alignSelf:stretch, but I also want the height to be according to the aspect ratio of the image. How can I ...
Param Aggarwal's user avatar
102 votes
15 answers
201k views

React-Native Button style not work

Import_this import {AppRegistry, Text, View, Button, StyleSheet} from 'react-native'; This my React Button code But style not working Hare ... <Button onPress={this.onPress.bind(this)} ...
MD Ashik's user avatar
  • 9,675
102 votes
28 answers
275k views

Invariant Violation: "main" has not been registered

New to React Native: I started a brand new project with Expo init and then I followed the instructions mentioned inhttps://reactnavigation.org/docs/hello-react-navigation I run the project with expo ...
Pankaj Sharma's user avatar
102 votes
7 answers
244k views

How to use zIndex in react-native

I've want to achieve the following: The following images are what I can do right now, but that's NOT what I want. Sample of code I have right now: renderA() { return ( <View style={ ...
SudoPlz's user avatar
  • 22.5k
101 votes
16 answers
175k views

React Native adb reverse ENOENT

I am trying to get React-Native to work with Android V4.2.2 (Genymotion) but I am unable to test the app on the Emulator. When I ran react-native run-android, I get this error Could not run adb ...
XPLOT1ON's user avatar
  • 3,164
101 votes
2 answers
19k views

How to get react-native run-ios to open in iTerm instead of Terminal on a macOS?

How can somebody configure react-native run-ios to execute in iTerm instead of Terminal on OSX? By default, it opens a new Terminal window, but Terminal doesn't work as well with my window manager as ...
emmby's user avatar
  • 100k
101 votes
29 answers
189k views

KeyboardAvoidingView not Working Properly

KeyboardAvoidingView not Working Properly I am trying to use the KeyboardAvoidingView with behavior="padding". For some reason, when I'm trying to enter any text in TextInput, there's a ...
Charan Teja's user avatar
  • 1,009
101 votes
29 answers
166k views

Close react native modal by clicking on overlay?

Is it possible to close react native modal by clicking on overlay when transparent option is true? Documentation doesn't provide anything about it. Is it possible?
acidernt's user avatar
  • 2,291
101 votes
11 answers
181k views

React-Native run-android on specific device

Is it possible to use the run-android command for one specific device only? For example, if I have three devices (or emulators) connected and I want to use run-android on only one of them? Maybe ...
Vic Torious's user avatar
  • 1,887
100 votes
11 answers
141k views

React Native init specific version

I upgraded my latest project to React Native 0.19 and instantly the video no longer works. How can I create a new project with a specific version? I want to init a new project at version 0.18.1. I did ...
Hasen's user avatar
  • 12.2k
99 votes
28 answers
216k views

ViewPropTypes will be removed from React Native. Migrate to ViewPropTypes exported from 'deprecated-react-native-prop-types

I am getting this warning in log : ViewPropTypes will be removed from React Native. Migrate to ViewPropTypes exported from 'deprecated-react-native-prop-types even I haven't used ViewPropTypes ...
Akshay Bhimani's user avatar
99 votes
11 answers
110k views

Detect ScrollView has reached the end

I have a Text with long text inside a ScrollView and I want to detect when the user has scrolled to the end of the text so I can enable a button. I've been debugging the event object from the ...
Eldelshell's user avatar
  • 6,880
99 votes
13 answers
277k views

Text vertical align in react native (using nativebase)

I was wondering there is a way I can align vertically in React Native. I'm trying to position on the bottom but I don't think I can find a good way to do it. If anyone knows how to solve this issue, ...
ckim16's user avatar
  • 1,689
98 votes
36 answers
131k views

How can we center title of react-navigation header?

React-navigation docs are still young, and reading through the issues is not working quite much for me (changes on each version) does anyone have a working method to center title in Android using ...
jsdario's user avatar
  • 6,745
98 votes
14 answers
166k views

React Native - open links in browser

Hi i am using react native's webview to display some html, i want that whenever a user clicks a link inside that html, it will open the user's browser with that link. is that possible? Edit 1: I ended ...
Matan Kadosh's user avatar
  • 1,771
98 votes
6 answers
145k views

What is react-native link?

What is the purpose of the react-native link command?
Nguyễn Ngọc Duy's user avatar
97 votes
31 answers
115k views

PhaseScriptExecution [CP-User] error in React Native

Nowadays everytime I create a new project react-native init ProjectName and after it is created I do npx pod-install and then react-native run-ios it gives me error. It happens with every project that ...
Chaudhry Talha's user avatar
97 votes
5 answers
69k views

Storing non-state variables in functional components

Below are two React Components that do almost the same thing. One is a function; the other is a class. Each Component has an Animated.Value with an async listener that updates _foo on change. I need ...
woodpav's user avatar
  • 1,997
96 votes
15 answers
78k views

Setting a timer for a long period of time, i.e. multiple minutes

I want to use firebase auth with react native for Login and Signup but I got a yellow error: Setting a timer for a long period of time, i.e. multiple minutes, is a performance and correctness issue ...
Saeed Heidarizarei's user avatar
96 votes
4 answers
118k views

Subscribe to single property change in store in Redux

In Redux I can easily subscribe to store changes with store.subscribe(() => my handler goes here) But what if my store is full of different objects and in a particular place in my app I want to ...
Rocky Balboa's user avatar
  • 1,486
96 votes
7 answers
89k views

How can I declare a PropType corresponding to a nullable number?

I'm looking for a PropType that means "this is required, and it will either be a number or be null" In other words, what I have now is PropTypes.number.isRequired but that throws a warning if ...
Ms. Corlib's user avatar
  • 5,123
95 votes
11 answers
66k views

No template named 'unary_function' in namespace 'std'; did you mean '__unary_function'?

Just upgraded my Xcode to 15.0, and suddenly it started giving me the following error in RCT_Folly No template named 'unary_function' in namespace 'std'; did you mean '__unary_function'? this is the ...
Mitesh Baraiya's user avatar
94 votes
30 answers
68k views

Error type 3. Activity class {com.awesome_project/ com.awesome_project.MainActivity} does not exist in react native (Android device)

I've created the project using the following command. react-native init Awesome_Project I've started the packager using the following command. react-native start I've connected my Android mobile ...
Srujan Chowdary Panda's user avatar
94 votes
6 answers
156k views

What is an alternative of textarea in react-native?

Is there any built in text area component for react-native? I have tried to implement these ones: https://github.com/buildo/react-autosize-textarea https://github.com/andreypopp/react-textarea-...
imran shoukat's user avatar
94 votes
1 answer
99k views

flex vs flexGrow vs flexShrink vs flexBasis in React Native?

I finally upgraded react native to 0.42 which includes the introduction of flexGrow, flexShrink, and flexBasis and the change (or fix) of how flex is rendered. I keep getting errors like: View ...
Dev01's user avatar
  • 13.9k
94 votes
1 answer
5k views

React Native app stuck on blank white screen with remote debugging using Nuclide

Steps to Reproduce / Screenshots Apply all operations from the instruction: Create a blank React Native project with $ react-native init [project name]. From the command Palette (Cmd-Shift-P), ...
Stich's user avatar
  • 2,371
93 votes
22 answers
221k views

How to set shadows in React Native for android?

Hi am trying to set a shadow for my fab but my attempts has failed so far i tried setting shadow props but that is for ios only so i tried to play with elevation property but it doesn't look right. ...
Ibrahim Ahmed's user avatar
93 votes
15 answers
93k views

"Invariant Violation: Application AwesomeProject has not been registered" When building for iOS device with static jsbundle

First off, I don't know react, but I figured deploying to an iOS device instead of the simulator wouldn't be too difficult to do with the docs. They were a bit sparse but I got somewhere and now I'm ...
cmp's user avatar
  • 1,613
93 votes
29 answers
220k views

'react-native' is not recognized as an internal or external command, operable program or batch file

I recently started with react-native. I install it using the tutorial on the Facebook site and everything works well for a day or two until this message comes up: 'react-native' is not recognized as ...
Adrian Sicaru's user avatar
93 votes
17 answers
135k views

KeyboardAvoidingView with ScrollView

I am sort of new to react native and have one question that I did not find in react native documentation. I am looking into this component KeyboardAvoidingView: https://facebook.github.io/react-...
user1341104's user avatar
  • 1,378
93 votes
4 answers
88k views

What is StrictMode in React?

I heard that strict mode helps to write React code in best practices way by throwing warnings for life cycle methods removal. I read about it from this article on Medium. Is my understanding correct? ...
Hemadri Dasari's user avatar
93 votes
6 answers
71k views

clang: error: SDK does not contain 'libarclite' at the path

After Updating to Xcode 15 I am getting the following error in my react-native app while it try to build it. clang: error: SDK does not contain 'libarclite' at the path '/Applications/Xcode.app/...
Engr.Aftab Ufaq's user avatar
93 votes
23 answers
160k views

ERROR - VirtualizedLists should never be nested inside plain ScrollViews with the same orientation

I'm working on a react-native app and I have to put a list of object in a Scrollview, so I use the FlatList component to do it. This is the piece of code that generates the error: <ScrollView ...
Alessandro Carughi's user avatar
93 votes
1 answer
79k views

Question mark before dot in javascript / react [duplicate]

I know what a ternary operator is in React. When I'm developing a React Native app I encounter this kind of syntax that is covered by my ESLint as an unexpected token: ESLint: Parsing error: ...
Robert Tirta's user avatar
  • 2,812
93 votes
5 answers
67k views

Is it possible to show warnings instead of errors on ALL of eslint rules?

As the title says, would it be possible for eslint to show warnings instead of errors on ALL of the rules? I'm using Standard JS, if that information is relevant. Thanks!
nrion's user avatar
  • 4,884
92 votes
10 answers
224k views

how to make the blur effect with react-native?

how to make the blur effect with react-native ? like 'background-image' and i want to switch the effect 'blur' and 'none','none' means no blur effect
12343954's user avatar
  • 2,601
92 votes
9 answers
225k views

react-native - Fit Image in containing View, not the whole screen size

I'm trying to fit images in their containing views so that I can have a seamless grid of images. The problem is that resizeMode='contain' seems to fit to the width of the screen or at least some ...
BarakChamo's user avatar
  • 3,535
92 votes
11 answers
284k views

setTimeout in React Native

I'm trying to load a splash screen for an iOS app built in React Native. I'm trying to accomplish this through class states and then a setTimeout function as follows: class CowtanApp extends ...
Phil's user avatar
  • 1,664
92 votes
14 answers
70k views

How to solve: console.error: "redux-persist failed to create sync storage. falling back to "noop" storage

I'm trying to setup redux-persist in a react native app. However I'm hitting this error: console.error: "redux-persist failed to create sync storage. falling back to "noop" storage I'...
user1872384's user avatar
  • 7,066
92 votes
14 answers
71k views

How to auto-slide the window out from behind keyboard when TextInput has focus?

I've seen this hack for native apps to auto scroll the window, but wondering best way to do it in React Native... When a <TextInput> field gets focus and is positioned low in the view, the ...
McG's user avatar
  • 4,959

1
3 4
5
6 7
2836