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-platfrom 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

100069 questions
879
votes
45 answers

What is the difference between React Native and React?

I have started to learn React out of curiosity and wanted to know the difference between React and React Native - though could not find a satisfactory answer using Google. React and React Native seems to have the same format. Do they have completely…
shiva kumar
  • 10,194
  • 4
  • 20
  • 24
657
votes
7 answers

What is the difference between using constructor vs getInitialState in React / React Native?

I've seen both used interchangeably. What are the main use cases for both? Are there advantages / disadvantages? Is one a better practice?
Nader Dabit
  • 47,131
  • 13
  • 103
  • 88
528
votes
31 answers

Hide keyboard in react-native

If I tap onto a textinput, I want to be able to tap somewhere else in order to dismiss the keyboard again (not the return key though). I haven't found the slightest piece of information concerning this in all the tutorials and blog posts that I…
TurboFish
  • 6,139
  • 4
  • 15
  • 27
508
votes
31 answers

React Native android build failed. SDK location not found

I have error when i start running android What went wrong: A problem occurred evaluating project ':app'. > SDK location not found. Define location with sdk.dir in the local.properties file or with an ANDROID_HOME environment variable.
Pyae Sone Nyein
  • 5,081
  • 3
  • 8
  • 3
441
votes
32 answers

How can I insert a line break into a component in React Native?

I want to insert a new line (like \r\n,
) in a Text component in React Native. If I have:
Hi~
this is a test message.
Then React Native renders Hi~ this is a test message. Is it possible render text to add a…
Curtis
  • 4,422
  • 2
  • 8
  • 7
425
votes
13 answers

Error Running React Native App From Terminal (iOS)

I am following the tutorial on the official React Native website. Using the following to build my project: react-native run-ios I get the error: Found Xcode project TestProject.xcodeproj xcrun: error: unable to find utility "instruments", not a…
JacobSiegel
  • 4,891
  • 2
  • 12
  • 17
400
votes
35 answers

How to do logging in React Native?

How can I log a variable in React Native, like using console.log when developing for web?
skyline75489
  • 14,089
  • 7
  • 43
  • 59
377
votes
49 answers

Unable to load script from assets index.android.bundle on windows

I'm trying to run my first React Native project for first time on my device (Android 4.2.2). And I get: unable to load script from assets index.android.bundle Commands that I used: cd (project directory) react-native start react-native…
Goba
  • 3,916
  • 3
  • 9
  • 11
352
votes
7 answers

What is the difference between Hot Reloading and Live Reloading in React Native?

I'm a bit confused here. When I'm debugging a React Native Application, I usually enable both Hot Reloading and Live Reloading. I want to know what is the difference between them?
Raman Choudhary
  • 3,843
  • 2
  • 11
  • 25
305
votes
12 answers

How to add icons to React Native app

I am making a React Native app. I would like to customize the app icon (meaning the icon that you click on to start the app). I have Googled this, but I keep finding different types of icons that refer to different things. How do I add these types…
Adam Katz
  • 5,706
  • 7
  • 36
  • 62
291
votes
47 answers

How do you debug React Native?

How does one debug their React code with React Native while the app is running in app simulator?
McG
  • 4,389
  • 3
  • 16
  • 13
281
votes
6 answers

What are my options for storing data when using React Native? (iOS and Android)

I am still new in the React Native world, and generally in the mobile/native world as well, and I am finding the documentation a bit lacking when it comes to data persistence. What are my options for storing data in React Native and the implications…
Sia
  • 7,128
  • 4
  • 26
  • 47
264
votes
18 answers

ReactNative: how to center text?

How to center Text in ReactNative both in horizontal and vertical? I have an example application in rnplay.org where justifyContent="center" and alignItems="center" is not working: https://rnplay.org/apps/AoxNKQ The text should being centered. And…
itinance
  • 9,334
  • 5
  • 44
  • 82
261
votes
18 answers

How can I generate an apk that can run without server with react-native?

I've built my app, I can run it on my local emulator (and also on my android device within the same network by changing debug server). However, I want to build an APK that I can send to someone without access to the development server and I want…
Gokhan Sari
  • 5,046
  • 5
  • 25
  • 26
254
votes
9 answers

What is the difference between Expo and React Native?

From the Expo website Expo lets web developers build truly native apps that work across both iOS and Android by writing them once in just JavaScript. Isn't this what React Native does? What's the difference?
1
2 3
99 100