How to develop Native Module for React-Native rapidly? - react-native

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!

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.

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.

Need to restart computer when developping

I try to make apps in react native (not with expo, I created my code with react-native init and run with react-native run-android) and when I make changes in the code they are not always taken into account : to take them into account I have to restart computer.
I have to do it several times a day, it is time consuming. I have tested to remove to app tested from the device, to make yarn cache clean, but it doesn't work, the only thing that works is to restart (I am using a Mac if it makes a difference).
Is there a command I can make to reset a cache that I don't know and save previous state of my app ?
You may have a caching issue, try the cache clearing solutions in this link
How to clear react-native cache?
And also, you may want to try the Hot Reloading or Live Reloading options in the dev menu.
What is the difference between Hot Reloading and Live Reloading in React Native?

Why deploying and debugging are so slow (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.

Will react native be supported by windows?

will react native be supported by windows os?Or linux . I don't own a mac so i was wondering if facebook plans to release react native for windows or linux. i don't want to run virtual machine because it's too much of a hassle.
I had successfully run the react-native on windows with a few hack.
The gist is here gist
Windows support would be awesome but cannot promise an ETA. We'd be happy to review pull requests that will make the CLI work on Windows.
You could skip the CLI and start with the Sample app from examples, build it with Gradle and start the packager manually using node node_modules/react-native/packager/packager.js.
Discussion here: https://github.com/facebook/react-native/issues/2693
This is not official support but I figured out how to get things working on Windows in a way that allows you to use the react-native CLI as documented without having to modify the source code.
The main issue that I encountered was with the hardcoded references to sh in React Native's packager. I solved this by adding Cygwin's bin directory to my path. Others have provided solutions for this where they modify the source code to work on Windows but I'd prefer not to go that route in order to ease updating to newer versions of React Native.
The other two catches where having to enable virtualization in my BIOS in order to get HAXM support and having to load the debugger page manually.
I wrote up some notes on the complete process here and intend to keep this up to date with future release of React Native:
http://davidanderson.io/2015/10/18/a-step-by-step-guide-to-react-native-on-windows/