React native application starting performance issue - react-native

I'm new to React Native developement and currently have performance issue when user launches app.
It takes like 5-10 second on both Nexus 6P emulator and my Samsung tablet to render content of the application.
Currently I have tab navigator as main component and three stack navigators inside of tab navigator and seems like react native tries to mount\render all of those components at once. Can you please tell me how I can solve this issue to create smoother user experience with my app ? Because all of my components are pretty lightweight and it's strange that I have any performance issues.

This slowness is natural because you are in the develop mode and you may showing some consoles on the console log. The problem will be disappeared if you publish the app and install the apk you will not have that problem. I hope it helps you.

Go to Android Virtual Device Manager, select your AVD, select "Edit this AVD", in the new window (Virtual Device Configuration), goto Emulated Performance > Graphics and select the "Software (GLS)"
This may enhance your performance issues, it worked well for me

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.

ReactNative App works on Simulator but crashes in TestFlight

I am developing a ReactNative app for iOS using Expo.
The app worked correctly on a real iPhone with just basic components (View, Text, Button & Styling).
However, I added Stack Navigation last night. The app had no issues on the simulator so I built through 'eas build' (also no problems). I submitted it to TestFlight for internal testing. But, when I click to open the app, it crashes immediately. As it is an actual app, it gives no info about the cause.
I am very stumped, so any help would be great. Thanks!
Solved this months ago but forgot to post the solution.
In case anyone is having a similair issue, the problem was really small.
I was using navigation components such as'createStackNavigator' instead of their native counterparts e.g. 'createNativeStackNavigator'. Made the swap and the app is now working properly.

react native expo building javascript bundle multiple times and fail

I'm currently developing react native app and kinda new to it. Sometimes when I open my app in expo(usually using my iPhone device to debug app) it building javascript bundle multiple times very rapidly and it's unavailable to open app in my phone while the expo bundler is keep building javascript.
Indeed I need to force server to stop and restart, sometimes it works but not always.
It's not a big issue since I restart the app It's okay but why is this happening?
this is my screenshot of building javascript in expo. green one is from terminal and white one is from expo...

Vue Native - Debugging

Recently I switched from Ionic framework to vue-native (vue.js wrapper around react-native), everything seems to be cool, development is fast and easy, but I have some real issues with debugging those apps. With Ionic Framework (Cordova) I was able to open an app in web browser and could easily manage Vuex state (for example) from Chrome Console. It doesn't seems so easy and trivial in react native world. Is it possible to have similar debugging experience in vue-native? When my app starts to grow and gets complicated it's really hard to handle it other way around. Any help appreciated.
Basically all my problems gone away when I ported my apps to Expo (which allows for JS remote debugging) and grabbed React Native Debugger - https://github.com/jhen0409/react-native-debugger.
Important part is having simulator installed on your developer machine (like iphone simulator) because debugger doesn't play nicely with real machines.
Inside debugger hit cmd+t to open a new window and set port to 19001 (because of Expo using this port). Now start expo with npm start command and in Expo panel hit 'Run in simulator' button.
In simulator make a shake gesture (ctrl+cmd+z) and allow remote debugging in developer menu.
Done. Pleasant experience similar to one known from Cordova. You have a js console, you can inspect elements and change styles live. Expo comes with live reload to make things smoother.
More info here: https://docs.expo.io/versions/latest/workflow/debugging/
Unfortunately, you cannot debug script parts in the VUE files in Chrome Dev Tools (you can put the breakpoints, but they are not working well), but if you put the methods to a separate JS file, it works like a charm. I know, it's a workaround, but not a big pain, and working well.
See my TODO app for example: https://github.com/TheBojda/VueNativeTodo

React Native vs CRNA [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Closed 2 years ago.
Locked. This question and its answers are locked because the question is off-topic but has historical significance. It is not currently accepting new answers or interactions.
I want to start with React Native app development and need help to decide on which path I should go.
The main question is: should I go with React Native or create react native app?
From what I understand, CRNA really is react native using the expo client and tools, with a more comfortable use (no dev account required, etc)
I can see the advantages with using CRNA over react native (no being no need to set up dependencies, faster time to start with developing, no need for iPhone dev account or xcode+android combi, etc.)
However, as not all native libraries are included, I see myself in the need to export my app at a later point anyway and continue to work with xcode and Android Studio just like before.
So, if CRNA is just a nice way to get started with everything, then I would go for vanilla react native right away as I see no point in a temporary solution at all.
Also, and maybe you can correct me on this, I do not like the idea to have just another wrapper on top of my app, unless there are some more crucial advantages which I missed out.
So could you please share your experience on this? If you have developed apps with react native in the past, which path did you go and which path will you go in the future? React Native, CRNA or React Native and expo environment?
Hi I will also share some of my experience on the topic.
Since I have a front end background and was not familiar with XCode or Android Studio I've decided to start my native app developement from CRNA.
Indeed with just a text editor, purely with javascript and utilizing built-in expo SDK components I was quickly able to implement and publish to Play Store a fairly simple app.
That I find truly amazing :)
However after publishing the app I realized there are some pitfalls that unable it to compete with similar rival Java apps:
The biggest IMO is the size of the apk generated with exp
service.
For the app with just 3 screens and not a lot business logic, 25 mb and about 60mb after install is really a lot.
According to expo devs more complex apps will be approximately the same size or only slighty larger due to the bulk of the size being the native dependencies, and not actual javascript side.
But this still is a big problem and I will probably have to anyway eject the app to optimze the build size
So in general CRNA is a great and fast way to start and have something working but still before publishing the app to the users you'll not avoid seting up your custom build and all the dependencies like Android Studio
I think create-react-native-app is a good way to start so that you can focus on the React part of react native, especially if you are not familiar with React. And when you are ready to do things with native you can simply eject with npm run eject
When I started a new project with react native late last year, there was no create-react-native-app and I evaluated expo first. I didn’t like it as there were no easy native integration unless you eject when I know for sure we will need native integration. Therefore I went with vanilla react native. Also I already had experience with React on the web and iOS and Android native development.
TLDR
if you create project by create_react_native_app myproject
then it contains expo setting (not recomended )
if you create project by react-native myproject
then its plain react-native (recommended for small ,medium,large to projects )
Note : to use react-native command in terminal use this link
I would like to share my experience of app development . As I was new with react I started with CRNA and it went smoothly . Expo really provides many features like push notification , animations (recommended Lottie by Airbnb) and peace of mind that you can eject your app anytime you want to use native libraries with app . Best part is you don't have to rewrite any code and all expo exclusive features will work as well .
Therefore CRNA(use as much you can)+eject(when you need native libraries) = sweet spot .