Why deploying and debugging are so slow (React-Native) - react-native

I have started to develop with react-native and i am struggling on technical issues all the time when deploying or debugging my application.
I tried running the app in two ways:
With expo (expo start)
With this option expo extract+compile+run my app on my local android simulator which takes 60-70 secodns for every change (via hot-reloading)
Running on my iPhone with expo client
That takes me also 60-70 seconds and debugging is not convenient.
Is there any way developing faster with react-native?
It takes me one hour for creting a simple screen with Form and AsyncStorage + checking the logic (insted of 10 minutes)
Thanks !

Could be many factors. Slow computer, hard drive full.... Perhaps clean your build folders. Very hard to diagnose from what little information you privide.

Related

My react native app with expo takes a long time to load

I developed an application in react native using expo and I have a problem, the app takes a long time on the splash screen before starting, I didn't use any method to make the splash visible for a longer time. The issue occurs in both the development version and the production version.
Another point is that I read in an article that IIFE functions should be avoided inside useEffect, and so I removed the ones I used but I still have the performance problem, does anyone have any ideas on how to improve?
If the connection is made but bundle building is very slow - Try disconnecting from the network both devices, and reconnect your system . Also, don't forget to clear the 'recently in development' projects, terminals and start the project again. It will increase the speed of building , especially for windows it works very well.

Use Expo Metro Bundler instead of react-native start

currently I'm migrating my react native app to expo bare workflow. Everything it's been fine so far, except for the following.
This may seem like a noob mistake, but I'm unable to use the Metro Bundler from Expo when I run my app from Xcode. Before, I could run from Xcode and the simulator would appear in the Metro Bundler with all it's logs, that was very useful.
I've been searching this for a couple days and the closest thing I've found to what I want, is using expo build:ios. The problem, it pops up a warning saying that if I'm not sure what I'm doing it's best to leave it as it is. It's a big application so I'm worried it might lead to errors, therefore I didn't do it.
If anyone knows for sure if this command is what I'm looking for, or has a better suggestion, it would be much appreciated. Thank you.
[EDIT]
To be more specific, I don't mean using the Expo Go app. I mean a standalone app (I'm not sure if this is the correct term for it). Thank you!!
expo build:ios is used for building an app bundle for your application. This is used when you want to publish your application on the store and that is why it asks for credentials of developer account on the iOS.
If you just want to run your app and check then you should use expo start. This will start the Metro Bundler for you and then you can run your application on your device scanning the QR code that would appear there.

react native run-ios command takes time like 8~10 mins. is it normal?

I am new to react-native and tried
'run-ios' command to run app on ios.
It took about 8~10 mins average to build.
I am wondering is it normal behavior of react-native.
I tried 'run-android' command on another lab-top and
result seems same :( So I am about to think this might be
normal symthom...
how much time you guys took to build react-native apps???
expo cli with expo start seems fast but react native run-ios
seems very very very very VERY slow...
Do I really have to wait 8~10 mins to build?
I am wondering am I suffering alone.
It depends on your app size, but first install always very long( build in xcode much faster).I recommend you don't use react-native run-ios, use debug tools,it will be faster. For example vscode has very simple debugger,but if you want run application at a time, you can use xcode build
i had the same problem, it was because of my slow wifi the build was slow.
test your build with a faster internet and see what happens.

React native takes very long to load on device

I've been developing a react-native app using the simulator for a while. On the simulator (iOS), the app loads very fast (on reload for eg). However, when I tried to load the app to the device, it spends between 1-3 minutes in the splash screen before loading into the app.
My project is fairly small, and has no extra resources other than the javascript. Looking at the documentation I couldn't find what might be the cause of the issue, though I suspect it has to do with the fact that it is not getting the JS from the packager local server.
What am I doing wrong?
(btw - react-native v0.31)
I ran into the same issue and discovered that it was because I was running my app on device in development mode. To get the performance you're looking for, you'll need to build and run the app in production or "release" mode. You can do this by passing in a --configuration option and setting it to Release using the React Native CLI:
$ react-native run-ios --configuration Release
If that doesn't do the trick, then you may need to build your app in "Release" mode from Xcode. To do that, navigate to your projects /ios directory and open the .xcodeproj file in Xcode. Choose your build target in the Toolbar. Scroll to the bottom and choose "Edit Scheme...". Then under Build Configuration, switch from "Debug" to "Release". Now build your app on your target device and it should be much more performant than before.
You can read more in the official React Native documentation under Running on Device: Building your app for production.
For me the issue was related to the wifi network of my development machine. I was using WPA2 Enterprise auth to connect to wifi on my development machine. I found that if I used a wired connection to connect to my network or if I used another wifi connection that used a different form of auth then the delay went away. I think the delay is a network timeout.

How to develop Native Module for React-Native rapidly?

I use Atom Editor and GenyMotion on Windows 10 to develop a native module.
However, modifying and trying code are take long time because of building (react-native run-android) and starting (react-native start) processes at every single time.
I wonder is there another way to develop in less time?
You can speed up the build process a little bit by running Gradle Daemon. But, You can't avoid the react-native run-android. Recompilation is mandatory if you are changing the JAVA code. But, You don't have to re-run react-native start again after the recompilation most of the times.
Using an SSD instead of an HDD provides an amazing benefit.
So, I've switch to using an SSD on a new laptop.
Do not look for another solution.
React-native makes a lot of disk operation with a lot of modules when it working.
It tries to access a lot of file. Using SSD is the best solution!