React Native vs Flutter - Which should you use?

45.99k views4119 WordsCopy TextShare
Simon Grimm
Should you use Expo or Flutter for your next project? Both frameworks look awesome from the outside ...
Video Transcript:
you want to build a mobile app in 2024 with a crossplatform framework but you don't know if you should use flatter or react native let me help you make decision based on effects not feelings each framework has its own pros and cons and the truth is you can build great apps with both so we need to dive more into differences and specific categories and nuances that separate flutter and react native throughout this video you will better understand where each approach shines or falls short and you will also be able to make your own reason choice
in the end we will start with some quick basic facts and then dive into the strengths and weaknesses of both Frameworks after that we will take a look at some real app examples and finally talk about concrete questions you can ask to choose the right technology and of course recommendations when which approach works best however as Luke petti said in his reaction to Theos Rand about flutterer these are tools not Lifestyles so please consider this a technical discussion and please stay away from pre-made assumptions and radical opinions what's that ominous glow in the [Applause] distance
first of all because Expo is now the recommended framework for react native I might change react native for Expo in this video every now and then but both flutter and Expo or react native are open source Frameworks for creating crossplatform apps we're not going into a ton of technical details at this point just really setting a baseline so what is flutter it was introduced 2017 from Google it's using Dart as the language and it follows a right on run everywhere approach what is Expo it is a framework on top of react native which started in
2015 at Facebook and no matter it's using JavaScript and typescript and jsx and it has a learn on VAR everywhere approach so you've most likely heard all the other General effect so instead of reiterating all of them we will talk about the really important stuff but before with that a quick disclaimer I run an online school called galaxies dodev where I help developers learn react native but I've always been in love with crossplatform tools starting with cover and ionic in the past I tried flut and react native and EP studio and whatnot so I will
try to make this discussion as unbiased as possible all right let's kick off this disc discussion on a positive note by talking about the strength first so what are the most obvious things that make these Frameworks great from the outside for flutter this is definitely an epic developer experience if you have tried it if you come to flutter and set up your first application it just works really really smooth and you instantly get something really cool in your application which is also related to the UI that you get out of the box in flutter applications
there are so many components you can drop into your appc appliation which makes prototyping and building an app really really easy and fast on top of that Dart is a language that's actually pretty cool it has null safety and there's a testing framework integrated so Dart isn't a bad language it's just that it's not really used a whole lot but if you're okay with using Dart then it's a good language and probably people going to like it more than JavaScript on top of that flatal applications usually have a good performance we're going to get more
into performance and the nuances here and there but overall you're going to see that usually flutter apps might perform a bit better in some statistics Expo on the other hand makes it really really easy to get started because pretty much every react web developer can build react native apps in a matter of like hours that was easy on top of that you get real native feeling more on Native stuff later and you can easily integrate native modules and all the platform apis within react native applications on top of that finding Developers for react native should
be an easy task because every react web developer can quickly upscale into that position and on top you got cool things like code push which allows you to update your application without going through the App Store process and the react Community is just Epic Big players like meta or Shopify are actively contributing to different packages and therefore help pushing react native forward okay so all of this sounds really good Simon but what really does suck about flutter and Expo okay let's talk about about some weaknesses now let's begin with flutter first of all you're going
to see people complain a lot about the widget trees everything in flutter is a widget and your code can get really messy if you don't know what you do yes you can split this up but overall in many application this looks really horrible then we got stuff like non-standard API interaction yes you can use the camera and most of the Native stuff but if you want to do 3D or AR stuff with flutter then you're going to have really really hard time on top of that web can rendering with flutter are you serious do we
even have to talk about that flutter for the web is just something you really don't want to do we've spoken of the good community in react native well there are packages for flutter but there's really a limited number of 30 party libraries available and it might be hard to find the right package and if it's not there good luck you're on your own one thing I found online was about nontraditional API interaction with flutter that was a nice quote God help you if you decide to use a flutter front end with anything like trpc or
graphql it's just a living breathing nightmare I can't confirm this exactly but I agree that FL is built so you use something like your own API uh standard rest API or Firebase with it also if you look at comparison you're going to find Less jobs for flut if you're interested in getting a job that might be a key argument the community is smaller and dart is really only used for flut I I don't know if anyone else using dart on the server are you serious I haven't seen that before and of course Google is behind
flutter and dart so we all know Google's history of deprecating things and last but certainly not least flutter is not native we could probably make a whole video on the topic that flut is not native but you can usually spot flutter applications they just draw Pixel Perfect animations and stuff on the screen but they are not embracing the native platforms that is an important distinction here between flutter and react native so if you're using flut it doesn't take advantage of all the things that the Android engineers and the Apple Engineers have done over the last
like 10 or 15 years I know flutter has great performance and with impella which improves um uh the rendering especially on iOS I think at the moment I think it's not on Android yet it will use more of the GPU to enhance that stuff but still again it is not native weaknesses of Expo of course there are weaknesses there is no UI out of the box there are like no components you probably got like a button and maybe an unside label but that's it so if you want to build react native applications you have to
do a lot of styling or find some component library but that's once again another story then also the learning core seems to be a bit harder so there's more to learn initially about react native and how to build your applications then there are a lot of problems related to um the general problems of web development kind of like there's the fatigue of all the packages there are abandoned third party packages you find something then you see the last commit from 5 years ago and you know oh I'm on my own here and all this stuff
just leads sometimes to confusion and just spending a whole day on like making no progress at all then in the past we also had performance limitations due to the bridge in react native applications so communicating between JavaScript and your native code was through a bridge and that was always a bottleneck this is going to get better with the new architecture coming soon to react native and JSI but still there might be some limitations and especially for all the applications these limitations will still exist some other General problems are just debugging with react native is absolutely
no fun and you're going to see this in a lot of Statistics people hate uh updates to Applications although Expo is making this a lot better um but overall you're just going to experience the pain of modern Web projects as I said with all the different packages with abandoned package and also it's evolving at rapid speed so you might be 5 10 versions behind if you don't watch out for updating application and then we come back to updating is challenging okay these were some general strength and weaknesses of both flutter and Expo but I have
a note that these things can actually be good and bad at the same time so how's that possible well take a look at the freedom of choice in react native projects many people value this people use Linux over windows or mag because they want freedom but on the other hand some people want guidance so having this freedom in react projects is a good thing but can also be seen as a bad thing same for rendering to Native components if you use a button with a react native it will render to the iOS native button and
the then right native button but do you really want that is that a good thing in your project or might it be a bad thing so you have to consider these things same is true for flutter flutter applications look exactly the same on Android and iOS that could be a good thing or could be a bad thing depending on what you actually want or that flasher is really opinionated maybe this is cool because it's giving your project a structure or maybe you feel limited by that opinion so you see there's no one siiz fits all
solution but we're going to talk more about some guidelines let's look actually at some example applications if you want to try out some flut applications I highly recommend you check out the Showcase of the flutter page you're going to find some uh applications using flutter and of course also some showcases I it was really cool to see supercell using this for their internal platform so not for all the supercell games uh but this internal platform was developed with flutter I'm a big fan of Clash of Clans so uh yeah that's pretty cool to see but
on the other hand uh the best thing might be to actually check out an application so I actually downloaded this my BMW app I don't own a BMW so I can't use it uh let me just click one thing Discover at benefits so if you now notice something that felt off then you might actually favor react native um if you didn't feel something bad then okay it's cool but usually uh as an iOS user I will feel that this transition doesn't feel native at all to me um but they're actually pretty good applications for example
this is the wondrous application and I think this is an epic application you see all the things going on here the transitions this looks really good and this is a lot better experience it is probably it is very far from a traditional Native application because there's so many special things going on and it is really performing uh in all the things going on in this application so check this out as a great showcase for flat room on the other hand you can check out a lot of applications built with Expo so here are a lot
of stories about companies using Expo and of course also there's the react native showcase um where apps listed using react native you're going to find a lot of big names in here and finally Evan bacon did put together a nice uh list of apps using Expo in oper uh OSS in 2024 things like Discord coinbase um NFL huge applications are built using either react native or both react native and Expo uh I also made a video about all the best applications using this so you can check this out once once again let's take a look
at an actual application so this here is the um this should be the Tesla application I don't own a Tesla but this application shows you all the things it has really great Snappy performance whenever I click something it just works I can play around it is instantly uh and this is the sort of stuff that you can build with react native all right so until now we've seen a lot about the basic facts we've seen some strength and some weaknesses for both flutter and Expo we've also seen some app examples now let's get even more
practical do you have previous react or Dart knowledge that is a nice indicator if for some reason you have Dart knowledge you might favor flatter if you already have a lot of react libraries built internally then react native is The Logical Choice do you want to access native platform apis directly in that case go with Expo the reason is simple with flatterer yes you can use some of the Native apis where flutter has built a wrapper around this but if you want anything beyond that then with Expo you can easily drill down onto that level
and access native apis directly yourself do you want a Pixel Perfect Design across multiple platforms then go with flutter with react native it renders to Native components but with flutter you can make sure that your brand and app experience looks exactly the same on all platforms because flutter is using this Sky rendering engine or impeller now on iOS which draws exactly pixels on a canvas so you can make sure it looks the same across all platforms do you want a web version of your application as said before the output of flutter web is really a
joke and you don't want to use that but with Expo with Expo router and all things coming for universal applications web is a first class citizen in react native applications today do you want to prototype really fast then go with flutter I said at the beginning flutter comes with tons of UI components out of the box so if you're just getting started you can throw in some stuff and in a matter of like 2 or 3 hours you're going to have a really good prototype of your application whereas with Expo and react native you're usually
lacking these UI components do you want to use code push then use Expo for flatter applications there's actually no such thing as code push because these binaries work differently with react native and Expo you can simply replace the JavaScript part of your bundle over over the air and update your applications without waiting for Apple or Google to review your application do you plan to have a team of developers then use Expo you're going to have a lot easier time finding react developers or react native developers than if you're looking to build up a team of
Dart and flutter developers do you want the best performance then flutter might be your choice although react native is very close up especially with the new architecture and uh removing that bridge bottleneck it's going going to be probably the same however in some statistics you're going to see flutter at the top and if you really care about like getting the last bit off performance of your application then maybe just go for a native application instead do you want an ecosystem of tools to create review publish submit your application then go with expo Expo has the
application Services EAS which makes incredibly easy to just push an update and then your app will be built in the cloud submitted to to Apple and Google and you can directly release it with basically just a click on top of that things like Expo Atlas reviewing PRS and directly uh putting an application from your colleague on your phone is just amazing with Expo so Expo is really focused on iteration speed and makes this part A whole lot easier do you want a future safe technology with an active Community then go with Expo as said before
players like meta Amazon Shopify many more contribute actively to different things like uh react native for Mac react native windows so if you want to bet on a reliable technology where big players are involved then react native and Expo are your choices because with flutter if Google abandons flutter for some reason at some point you're going to be pretty much on your own the community is great but it's not as active as the react native Community all right so these questions should already point you somewhat in the right direction but let's get even more precise
with some guidelines so you should pick Expo when you already have react experience or code in your company when you want to build a web and a mobile application from the same code base when you want to use native platform apis and components when you want to build fullstack applications with the same technology on the API side when you want to access the latest native platform apis that Google and Android release when you plan to work with different apis like trpc or graph ql and when you need code push in your application you should pick
flutter when you already have Dart knowledge or developers in your company you want to prototype very fast you want to build more custom app experiences probably even closer to games you want the exact same UI on all the platform where your app runs you want to also focus on desktop or especially embedded devices all right so let's wrap it up with some final thoughts about the future so what does the future hold for for Expo and flutter U will one framework Dominate and win like most videos and articles uh make you think the statistics might
make it look like flutter is currently more popular but react still dominates the market especially in Western countries and companies just reuse their code and skills and many of these companies have over the last years developed their websites with react so traditionally they will go for react native over the next time on the other hand you see that flutter is really popular in countries like India and I talked to people from there and they told me that Google invests a lot into education in countries like India so it's just natural that the flutter adoption is
a lot higher there compared to other countries most likely both will simply continue to coexist and cater different markets as we've outlined before there are a lot of things for Expo there are a lot of things for flutter so you can select which fits your situation best the future for Expo looks really great react native is powered by the Community Players like meta Microsoft Shopify Netflix Sony they all contribute and react native is heating for version one maybe because we're actually still not on version one uh but overall we're just going to have a better
architecture no more Bridge no more bottleneck and I think developing apps crossplatform apps with react native will be sort of a standard in the future on the other hand flutter brings out impella for iOS I don't know if this is also coming to Android for Improv rendering but of course they will continue to build out their like performance gains on these platforms however flusher is also really really strong on embedded devices so probably going to see more flutter or D Target these devices in the future and they of course have uh Google in the background
so whether it be the gemin API or things like Firebase that you can easily plug into your application they will probably also double down on all the things that you can embed with Google in flutter applications a lot easier but one quote that made me think about flutter was that flutter has little to zero backing Beyond Google if Google dropped it tomorrow it would die very quickly I don't know if this is really the case but it paints a very dark picture of someday where Google just thinks ah we don't need this flatter thing anymore
I don't see this day coming anytime soon because they using it in a lot of their interal tools like Google pay or whatnot so this day might be far off in the future but both Expo and flutter have a bright future uh I think both communities can actually learn from the other things that flutter made great are coming to react native for example react native has skia and the rendering can be used to draw on there William cillan did a great job in bringing skia to react native and on the other hand maybe flatter will
have code push one day if they figure this out or they adopt some other patterns from the react native world to render components in a better way but overall I just think that both will simply invest into the areas where they Shine the most so of course all of this comes down to picking the right tool for the right job and I hope this video gave you enough input to make your own best possible Choice based on the strength and the weaknesses and the Epic samples that we've seen and try to make this as unbiased
as possible from someone running a react native online school however I generally think that there's only a fraction of applications where flut really makes sense and I think for most noral applications you are far better off with using Expo there was a great quote that I found that said developers use flutter companies use Expo and I feel there's a truth in this if you go through YouTube and I did a lot of research you're going to find a lot of comments Pro flutter and people screaming flutter is the future the trend is your friend everything
is great about it but if you look at the reality if you look at the job market if you look at big companies they are all using Expo and react native yes there are some exceptions if you're a solo developer or an agency you can build really shiny applications with flutter but overall for me the upsides of react native just dominates and we got the active Vibrant Community behind Expo and react native that's just making it feel like you're at home and it's just fun to work with react native yes there are things like debugging
that maybe suck but these can be improved in the future but the foundation of react native and Expo is to me a lot more enticing than what flutter does with it pixel per rendering so definitely make sure you subscribe to the channel if you want to learn more about Expo and react native and of course check out my Pro courses on galaxies. Def to learn and ship apps faster oh and if we want to see something more practical I will pin a video up here on some companies using react native for their applications so go
check that out and I will catch you in the next one so until then Happy coding Simon [Music]
Copyright © 2024. Made with ♥ in London by YTScribe.com