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.

React Native is an open-source framework created by Facebook that lets you build mobile apps using only and some basic and . It uses the same design as React, letting you compose a rich mobile UI from declarative components.

React Native apps are not "mobile web apps" or "hybrid apps". They are real cross-platform mobile apps that are indistinguishable from apps built using or . is often used to bring clarity in development.

The idea behind React Native can best be captured by the slogan "Learn once, write anywhere", enabling developers to use the same development approach for both desktop/browser and mobile apps.

Technically React Native runs the JavaScript code for a React app in a background thread. Updates to the virtual DOM are collected, and all changes are sent through an API into the native portion of the app. By doing this, React Native avoids slowing down the FPS rate of the app by not making the app wait for unfinished JavaScript operations.

Resources


Related tags

133828 questions
207
votes
30 answers

Hide/Show components in react native

I'm really new to React Native and I'm wondering how can I hide/show a component. Here's my test case: this.doSearch({input: text})} />
Crysfel
  • 7,926
  • 3
  • 33
  • 41
202
votes
9 answers

Is using async componentDidMount() good?

Is using componentDidMount() as an async function good practice in React Native or should I avoid it? I need to get some info from AsyncStorage when the component mounts, but the only way I know to make that possible is to make the…
Mirakurun
  • 4,859
  • 5
  • 16
  • 32
202
votes
14 answers

How does one Display a Hyperlink in React Native App?

How do I display a hyperlink in a React Native app? e.g.
Will Chu
  • 2,073
  • 2
  • 11
  • 6
202
votes
15 answers

How do you style a TextInput in react native for password input

I have a TextInput. Instead of showing the actual text entered, when the user enters text I want it to show the password dots / asterisks (****) you typically see in apps when typing a password. How can I do this?
bwbrowning
  • 6,200
  • 7
  • 31
  • 36
199
votes
28 answers

React-Native another VirtualizedList-backed container

After upgrading to react-native 0.61 i get a lot of warnings like that: VirtualizedLists should never be nested inside plain ScrollViews with the same orientation - use another VirtualizedList-backed container instead. What is the other…
David Schilling
  • 2,442
  • 3
  • 17
  • 24
198
votes
24 answers

How to show SVG file on React Native?

I want to show svg files (I have bunch of svg images) but the thing I couldn't find the way to show. I tried to use Image and Use components of react-native-svg but they don't work with that. And I tried to do that with native way but it's really…
the_bluescreen
  • 3,126
  • 2
  • 18
  • 31
197
votes
21 answers

How do you hide the warnings in React Native iOS simulator?

I just upgraded my React Native and now the iOS simulator has a bunch of warnings. Besides fixing them, how do I hide these warnings so that I can see what's underneath?
Some Guy
  • 12,768
  • 22
  • 58
  • 86
195
votes
16 answers

How can I view network requests (for debugging) in React Native?

I'd like to view my network requests in React Native to help me debug - ideally in the 'Network' tab of Chrome's devtools. There are some closed issues about this on GitHub (https://github.com/facebook/react-native/issues/4122 and…
Mark Amery
  • 143,130
  • 81
  • 406
  • 459
191
votes
9 answers

How do I add an element to array in reducer of React native redux?

How do I add elements in my array arr[] of redux state in reducer? I am doing this- import {ADD_ITEM} from '../Actions/UserActions' const initialUserState = { arr:[] } export default function userState(state = initialUserState, action) { …
coderzzz18
  • 2,535
  • 5
  • 16
  • 23
190
votes
13 answers

Run react-native application on iOS device directly from command line?

Is it possible to run react-native application on an iOS device directly from the command line like we do on simulator with react-native run ios --simulator "iPhone 5s"?
Aakash Sigdel
  • 9,060
  • 5
  • 33
  • 38
184
votes
14 answers

React Native add bold or italics to single words in field

How do I make a single word in a Text field bold or italics? Kind of like this: This is a sentence with one word in bold If I create a new text field for the bold character it will separate it onto another line so that's surely…
Hasen
  • 11,710
  • 23
  • 77
  • 135
181
votes
29 answers

Package signatures do not match the previously installed version

This my project: https://github.com/kenpeter/my_hak_news, which is a direct copy of https://github.com/grigio/HAgnostic-News. Git clone https://github.com/kenpeter/my_hak_news, then run react-native run-android Got this error: * What went…
kenpeter
  • 7,404
  • 14
  • 64
  • 95
180
votes
24 answers

Could not find tools.jar. Please check that /Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home contains a valid JDK installation

FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':react-native-linear-gradient:compileDebugJavaWithJavac'. > Could not find tools.jar. Please check that /Library/Internet…
Anandu Viswan
  • 1,803
  • 2
  • 5
  • 4
179
votes
7 answers

How to create helper file full of functions in react native?

Though there is a similar question I am failing to create a file with multiple functions. Not sure if the method is already outdated or not as RN is evolving very fast. How to create global helper function in react native? I am new to React Native.…
cjmling
  • 6,896
  • 10
  • 43
  • 79
177
votes
9 answers

spawnSync ./gradlew EACCES error when running react native project on emulator

I am trying to use react-native run-android to install my react-native application on an android studio emulator. I have checked with abd-devices that the emulator is available, and I have ran npm-install. I am using Ubuntu 18.04 with the…
dudeperryfect
  • 1,787
  • 2
  • 7
  • 6