Check out this ADR i made not too long ago, where I made critical architectural decisions for a project:
We want to create a mobile app.
We need to decide on the tech stack.
From the requirements, we can take few things to consider:
The 2 leading technologies for writing cross-platform native apps are react-native and flutter.
Here's a small comparison between the 2:
react native | flutter | comments | |
---|---|---|---|
easier to develop | ✅ | ❌ | |
most popular | ✅ | ❌ | |
development time | ✅ | ❌ | react-native is faster to code but offers less prebuilt UI components and usually requires additional platform-specific optimizations, which might make flutter better in terms of time to market |
maintenance | ❌ | ✅ | more research is needed on this point |
performance | ❌ | ✅ | performance difference is negligible, i couldn’t find a proper benchmark comparison, but i found this article |
So far i lean towards react native to create a cross-platform native app:
When it comes to startups, React Native is considered to be a better option.
The reasons mostly revolve around ease of finding developers, better community support, and better performance.
Important Advantages of React Native
Interesting Links
Transition from ReactJS to React Native
A great benefit of react native is that we are already familiar with ReactJS very well.
So how close is react native to react.js?
The gap between react and react native is relatively small:
there are additional things to learn:
These are relatively not a cock block for transitioning from web to mobile and after 2-4 months of grinding, may only take 10-20% of dev time. the main form of writing, reading, testing, debugging code; more the most part, stays the same. and that's 80-90% of the time the dev will spend on the mobile app.
Considering it is a similar app to the one in our requirements, its interesting to see what Atmosfy decided for their tech stack.
THE Atmosfy TECH STACK for the mobile web app includes React.js as the front-end library, Next.js for hybrid server-side and client-side rendering, Redux for state management, Apollo for data fetching, and TypeScript for type checking. The Atmosfy native app is built with React Native, allowing deployment to the Apple App Store and Google Play from a single code base. Both the mobile web app and native app are built using continuous integration with Bitbucket.
Cross-platform (Native-Like) VS Platform Specific (Native):
It is important to understand what we wont be able to do well or if it will be at a high cost. this is the most important decision we are going to take tech wise. So we also need to do a comparison with developing a native app per platform: one for Android and one for iOS. using S**wift & Kotlin (leading programing languages for Android & IOS native development)**, what are the pros for having 2 code bases (one per platform) ? vs the current state of react native? for our type of app of course, we are not talking about a video game.
How Important Is Performance?
The Performance Scale
preformance scale | matching app to performance | performance details | technology |
---|---|---|---|
none-native | blog | small apps without complicated UIs | ionic |
like-native | social media | apps with varied content and UIs with simple animations | react native |
compiled-to-native | big online store | apps with varied content and UIs with complicated animations | flutter |
native | real-time gaming | apps with very complicated UI and 3d graphics | kotlin, swift |
for our use case, like-native sounds good enough.
Cost
In terms of cost, building an app per platform (ios & android) is usually an x3 DEV cost considering you write everything x2 (and sometimes by different people) + in languages that are slower to read & write in + QA is also x2 as you continually making sure the 2 apps look/feel/behave the same.
Detailed Comparison 2022
kotlin-swift-flutter-mobile-apps-trends-in-2022Kotlin is said to be a cross-platform language, it might be worth to look into it some more if that’s the case.
Popularity
I looked at some statistics, depending on where you look, you will find different results. But it's safe to say React-Native and Flutter are leading the Cross-Platform mobile frameworks space in 2020-2024. With a slight edge to flutter in the last 2 years, I did some additional research as to why flutter became more popular.
When looking at npm trends you can clearly see React Native usage is growing exponantially.
Which means It's popularity goes up, not down. Developers are attracted and leaving other languages and frameworks and are entering into the React Native job market.
This is further proven when looking at the job market
Linkedin is a good reference point, and is also unbiased.
There are 16,000 RN jobs in linkedin and 773 are new.
Flutter only has 12,000 jobs in linkedin and 709 are new.
At least in new job recruitements, RN and Flutter are neck in neck. and overall there are 33% more RN jobs.
From this interesting discussion flutter_job_market, There is indeed a job shortage difference.
This is a bit weird. When comparing github stats (Jul 12, 2024) Flutter has 26.9k Forks and 163k stars. and react native has 24.1k Forks and 117k stars. This means that Flutter is truly more popular. so then, is there anything else to say about popularity?
YES! The reason why Flutter is more popular and React Native has more jobs is elusive, I'll give you my analysis on it.
There are a few reasons for what we are seeing.
Kotlin VS React Native 2024
react-native-vs-kotlin-mutliplatform-guideKotlin is a serious contender among cross-platform solutions. The choice between React Native and Kotlin Multiplatform will depend on your app's needs.
Teams that prioritize the velocity that hot reload provides, are satisfied with near-native performance, and don't mind occasionally writing native code might find React Native more suitable.
If your app uses a lot of native features that will require writing a lot of native code on React Native, or you prioritize native performance, Kotlin Multiplatform could be the technology for you.