Should you use Expo for React Native in 2023? 🤔 React Native CLI vs Expo

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
should you use Expo for react native projects in 2023 or should you use the traditional react native CLI in this video I will show you all the pros and cons for using Expo hey everyone what's up this is Simon from galaxies.dev and before we dive into the topic make sure you hit the Subscribe button because it's the easiest way to show a little bit of appreciation for today's video If you start your react native Journey you're gonna encounter one question right in the beginning of setting up your environment and the question is should you use the Expo go quick start or the react native CLI quick start this is like a crossroad and this can be very challenging for a beginner who's starting with react native so let's explore this if you're picking the react native CLI QuickStart this is pretty much like the traditional way of starting react native applications you set up your development environment with all the tools with Ruby uh with probably xcode on a Mac and then you run the initial command to generate a new project and later on you can start react native the metro bundler and run your application on IOS and Android this is the traditional way of creating reg native applications it involves later linking different packages you have to control your native was an Android project and you're just responsible for pretty much everything that happens on the other hand we get expo Expo is a way to quickly run your application uh in something called Expo go so if you're using Expo go there's an application you can install an Android iOS and even on the simulator if you then initialize a new Expo project and run Expo start you get a QR code that you can scan and it will immediately bring up your application on a native device in here which is pretty amazing if you see this the first time you're like wow I'm the god of mobile applications but overall Expo is an open source framework for apps that run natively on Android iOS and the web and Expo brings together the best and yada yada yada so to me Expo is actually like a suit of different tools because there's really a lot included we got the Expo SDK which allows us to use things like the accelerator application battery camera and so many more packages easily in our application but just installing them with Expo installed something and then you can use this native feature or package with Expo additionally Expo has native modules we're going to come back to this later because this was a very hard object in the past and you can now easily create your own native modules with Expo additionally we got Expo pre-built we're gonna talk about that in a second we got the Expo CLI which is pretty helpful to run our application or add packages or build the app and we got of course the Xbox Go app which we've seen before which allows us to preview our application and finally there's also the Expo application service EAS which helps us to build and submit our application in the cloud so we don't even need a Mac at some point to build an iOS application for example so that means if you opt into using Expo for your react native application you get access to all of these things now the question as a beginner is of course I want all of that why shouldn't I use it well there are certain limitations with Expo and the workflow is somewhat different from the react native CLI and in the past people brought up a lot of problems so let's go through that for example uh two years ago Johnny brought up the problem of not having the ability to copy to the clipboard and not having the ability to open other applications from your own application well looks like this is solved there's an Xbox clipboard package and there's also Expo linking available which allows us to easily open other applications from our Expo react native application one year ago Esteban brought up the problem of push notifications and well we now get push notifications with Expo and there are also other very popular packages like one signal which has Expo integration so push notifications also not a big deal anymore in-app purchases was always a challenging topic and it kinda still is because the development of Expo in-app purchases is currently paused but there's a great alternative and I know most people are actually using something like Revenue kit or glassify to actually manage their in-app purchases and subscriptions and revenue kit for example has an expo integration so it is certainly possible to have in-app purchases or subscriptions with Expo a very common objection that you will find in many videos like in this from Ben about three years ago is about Native modules so Ben for example wanted to use something like vector icons will react native and it was simply not possible back then to integrate custom native modules you only had the expo apis well today you can create your own native modules with Expo there's a guide on doing this so you're pretty much free to create every possible native module that you want for your Expo application so this is also a thing of the past finally there was an objection about ejecting expo from your application so if in the past at some point you notice that well probably I don't want Expo anymore you could eject expo from your project but it felt really like a pain in the backside to go through that process I did it myself it can really break your application and you are left with a lot of puzzled pieces however what they did at Expos X actually eject is a thing of the past and the solution today is called pre-built and what Expo pre-built what you do is you run this command npx Expo pre-built and it will generate an xcode and an Android project in your react native application and guess what you can then manage that native project right in there so that is a pre-built and it works pretty Flawless you can then run that local preview directly on your Android and iOS devices and it is a great replacement for Expo eject so although most things that were brought up in the past videos about problems with export are now gone there are still open issues you can check out this board at expo.kenny.io and you're going to see in-app purchase is still the most uploaded feature request because it's not completely natively working with Expo and there are other elements so I would go through that list and check out if there are certain things that your application definitely heavily relies on that are not yet implemented and in those cases it it might be actually the case that direct native CLI is preferred for your project however with the different Expo workflows you actually get the best of both worlds so there's the manage workflow and there's the bear workflow and by default you're using the manage workflow with Expo which means you can use the Expo Go app you don't need to manage native projects yourself and this is very convenient for people getting started but also myself I've used quite a lot of tools for building native applications and I was kinda yeah I was actually kind of surprised how easy it was to use Expo go and how fast it was and it felt kind of convenient and I really enjoyed the developer experience but if at some point Expo managed workflow is not enough for you and you want more control you can go for the bear workflow with a bear workflow it is pretty much the Expo eject or pre-built today which means you generate the native project you can customize things in either xcode or Android studio and apply changes to the plane or the Gradle or the configuration or anything you want and with that better workflow you have some more control you don't only use JavaScript because you might need some Swift you might need some kotlin but you can actually still use all the other things from Expo so really you get the best of both worlds and I think this is a pretty cool thing because Expo seems to never lock you in today you can still opt out with a pre-built but overall this is pretty pretty impressive in 2023. on top of that there are some additional benefits for using Expo for example for everyone getting started it is really that easy you don't need any kind of knowledge about xcode Android Studio native tools you just write your regnative code with JavaScript typescript use the Expo Go app you can even build your app in the cloud and you can become native mobile developer and release a native app without kind of having to ever touch a native project additionally I found it pretty cool that my application runs on the device without even being connected because it serves through Expo go in the local server so there was another Plus for me and as well for people who don't have a Mac you can now actually build your iOS application with the EAS in the cloud and then deploy to your device so that means if you want an iOS application you don't need to have a Mac yes debugging is a bit more complicated and challenging in that case now would certainly not recommend that for like really developing an app but it is to some degree possible and on top of that you get some cool more benefits if you actually using EAS because with EAS you can let your app be built in the cloud and from there you can actually submit it to the Apple App Store and submit it to the Google Play store so you don't need to do this locally you don't need to sign your application locally and all of that is possible with the EAS and on top of that you even get access to updates over the air updates which means you can update your application without going through the review process of apple and Android because you're just updating JavaScript styling images whatever and you can do this over the era and finally there is also a way to develop for the web with Expo which is of course very enticing so you kind of came from react web to react native and now we're going from react native to build a website again I don't know if you really need this but it is an interesting way to really just have one code base but spoiler watch till the end I'm gonna tell you another way how you can reuse your code base for Native so let's answer the question should you use Expo for your react native application in 2023 I asked this question on Twitter and most of the people and there were quite a lot of people actually replying to this said yes Expo is epic if I look at this there are a few in the beginning too I replied to I don't like the developer experience most people say yes yes yes it's amazing definitely 100 no question yes yes using it since years yes it's the best 100 and yes yes you see all of this so like 95 of people saying yes go with Expo and I would completely agree to that because if your application is a traditional application and you also maybe don't know upfront what you're gonna do yes just go with Expo you can later still use pre-build or something else but you can get started immediately and very fast with Expo if you know that your application requires certain functionalities that are not yet implemented by Expo and it's going to be very hard to add them or if you're using tons of native modules and I need to write a lot of custom things probably go with a react native CLI if you really know about that upfront and the challenges but otherwise it's definitely a yes for using Expo with react native now one more thing before you leave off and that is there are actually more ways to reuse your react skills this is not very popular in the react World and I actually don't know why but you can use capacitor to rep your whole web application written in react into a native application and access native device functionality and also easily build a native project you don't get the comfort of Expo and not seeing a native project but to be honest at some point it is actually pretty easy to just manage an xcode an Android Studio project so if you want another way to really reuse 100 of your react code go check out capacitor I've got tons of videos on this channel about capacitor with react with next JS and also how you can add the ionic framework as a UI framework to your application because then you can really completely use your existing react web skills to build native applications and on your way out don't forget to hit the Subscribe button and the like button to get notified about all the upcoming explain videos tutorial live streams and everything going on on this channel and check out galaxies.dev which is my online platform to help you with all the questions about modern web and mobile development so I'm of course decoding
Info
Channel: Simon Grimm
Views: 80,624
Rating: undefined out of 5
Keywords: cross platform, hybrid app, javascript, capacitor, web development, mobile apps, mobile app development, reactjs, react native, expo, expo react native, react native expo, expo js, react native app, react native tutorial, react native project, react native course, javascript tutorial, react native tutorial for beginners, react tutorial, typescript, react js project
Id: q-sKCsscIsc
Channel Id: undefined
Length: 12min 39sec (759 seconds)
Published: Tue Mar 07 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.