My React Native Journey
Tags: reactnative, javascript, mobile, webdev
Published: 2022-11-25 11:10:33

Hi there, My name is Darshan. I work as a Full Stack Engineer and today I want to share my journey with React Native. This blog contains everything I have learned and experienced with React Native.

I bet it excites every react developer out there when first time they get to know about react native. We can finally write native application in JavaScript. So we spin up our machine create a fresh project and start writing our app. 
 
## Think like Mobile Engineer

It's okay if the subtitle didn't make sense to you right now. I can understand we have background of web engineer. We don't know anything about mobile engineering and that's totally okay. 

In my early day and even today I use to observe a lot of native applications and I compare them with my project and I try to figure out how can I improve my application with that. 

Let's suppose you are building a chat app, you can take a reference from WhatsApp or Instagram messaging. Try to figure out what things are need to be added or improved. We will take more about this later in this blog. 


> Avoid over comparing.

![men drinking beer beyond his limit](https://media.giphy.com/media/e6TR9n00dL3JS/giphy.gif)

This was my problem. I used to over compare a lot and it made me sad.😅 Lots of time I wanted to quit my project and do something else.

But that's totally okay if you can't reach the perfection in one go. It will come in iteration of versions. Don't put too much stress on yourself. 

## Expo to the moon 🚀 

If you are just getting started with React Native. You don't want to juggle with all the native side configuration and language. Expo is probably a safe option to get started it.

## Spend sometimes with Native Environment

It was 50% lie when someone told you that you only have to deal with JavaScript. Sometimes you need to configure native environment to make a feature work. You may have encountered with library which need native configuration. 

So it would be good if you get used to it as early as possible. It will definitely going to help you in long run. 


## User experience matter the most

It's okay if your app UI doesn't look good but I think as Mobile engineer (I hope you are thinking yourself as same 😅)
You should always try to improve the user experience that's the reason users prefers Native apps over Web app.

Take an example of Forms. Forms behaves differently on Native Applications. 

Accessibility of Keyboard: When the keyboard shows up the field should be moved up and have enough space between the keyboard and field so users can see whatever they are typing. (Common sense right 😅) In mobile we need to take care of this things explicitly.

Feedback: Users loves to see what happens when they do some interactions with your applications. For example showing loading indicators, Showing Popups, etc. 

## It should work without Internet

If your application is not working without internet, It won't make sense to install it at first place. You should always integrate offline storage in your app. when users close your app and come back your app should resume from the last state. 

You should give a feedback when the app is online/offline. So users are aware of what is happening in background.

Even though you are making a basic app like TodoList. This will make good impression on users. 

### Performance 

Although this section could have covered in User experience section but as we are taking about React Native I want to briefly share my thoughts about it. 

You must have heard, when it comes to performance, react native may not a good to build an app. This is totally wrong and this specifically depends on the use case of the application. There are plenty of blogs and talks which justify when to use react native. So I am not going to write anything about it but React Native performs well and there are plenty of good companies even MNCs are investing in React Native so we don't need to worry about that part. 

Also React Native is changing, They have recently announced the new architecture that's basically changes the communication part of React Native. (You can read more about it [here](https://techblog.geekyants.com/rethinking-react-native-architecture-part-i)). Future of react native is far better.

### Always start with android.

If you are targeting both platform, focus more on android. iOS has blazingly fast CPU processing power so you might or might not see the performance bottlenecks.

Test your application in low-end devices and make sure everything is working as expected. You may need to invest more time.

Like any react web applications, Avoid unnecessary re-rendering. You can profile your application and figure about which component is causing re-rendering.

You can use debugging tools like flipper to debug better. It has plugin support so you can install or make plugin. That will make our life easier.   

### Keep Building Stuff

Lastly, I would recommend keep building stuff whether it is clone app or your idea unless you don't build it by yourself you will not understand. Avoid tutorials hell.

I know this blog was very general after all it was my experience with mobile engineering with react native. 

Thanks for reading, I hope this blog has helped you. If you are having any questions related to this blog or react native you can put those in a comment box. 

All the best. ✨ 
DM me at [iponikar](https://twitter.com/iponikar)