There is one last thing I would like to show you before we start doing something useful.
Our own application.
So far we have learned how to use React Native, but in the next section we'll build something our own.
So the last thing I would like to show you is eject.
So basically what is eject is a way to eject expo from our project.
So far we used Expo for everything.
And as I said early in in this section, we have a few ways to do it.
So if you go to React Native main page here and if you scroll down basically the first thing what they
ask you to do is to run this command here.
So basically this command npx react native init my test up will create an application for you, but
it's not going to use expo.
It will use a react native cli.
So if you go here and I show you that before we had two options we could go for a expo CLI or we could
have a React native CLI quickstart.
I picked the expo because it's much easier to to do and there is no good reason for having this CLI.
But if at any point you would like to have your own native plugin built by yourself and control everything
by yourself, then you can eject expo.
So basically you have an expo project and then you can eject it.
So you will end up with this project.
You can still maintain in the code will be the same, but you will lose whatever it's coming good with
Expo.
So Expo can build a binary file for you on both platforms.
It has a lot of components.
So for example, if we go to the Docs Expo IO and you can see here, I'm inside API reference, so any
component here, we have any plugins that are it's a huge library of different things that are available
for us and that's a part of the expo.
So basically if you will eject from Expo, you kind of losing that way.
You can still mark to eject it with SDK Expo, so all the plugins will be also included there, but
there will be no way that you can still develop other things using Expo as you used to do.
So for example, in the API reference you have a lot of things to use.
For example, if you would like to use camera, you have a plugin for that.
So the reason to go react native CLI is for something that Expo doesn't have and if you need to have
that in your application, an expo, lack of that and then there is no plugin for that and you will
need to go for something a native, then you need to eject it and I will show you how we can do it and
how actually our structure will change doing that.
So this is what we have at the moment.
We have Expo and Expo Shirt.
What I will do here is I will do expo eject and enter enter.
So I will make it a little bit bigger.
So how would you like to eject your application?
And you can pick bare.
I would like to bare.
Write a React Native project X pocket.
I will create a log in and with expo account to use React Native and Expo SDK.
Or you can cancel.
I will continue with my current project structure.
So basically I would like to.
What you could do is you have two options.
You can cancel, but you can go bare reactive native project as or you can also include whatever it's
in the Expo Expo kit.
So all the, all the plugins and everything will be included there and it will be still being able to
use.
We haven't used anything from there.
So what I will do is I will do bare.
I would like to bare React native project here and I will show you how this is different.
So how should you app appear on the user's home screen?
We'll need to give it a name so I will do movie mobile.
I'll altogether.
And then I can do the same.
So what is happening here?
You can see on the left hand side, it will create two folders for us, iOS and Android here.
So basically from that point you will need to take care of the project by yourself.
So you need to take care of everything here and it will take a while to eject it.
But pretty much if you go in Android here, I'm not sure it is already have everything here, but you
will have a file that with a configuration.
If you already done some native development then you will be familiar with that.
But basically you have the everything here that you normally could open that with Android studio.
And the same thing with the iOS.
You can open that in Xcode and get it from there.
But this has been ejected, so we kind of lose whatever expo could offer us, but we still can run this
application.
So I can go CD iOS and normally you will need to install Pod.
So I already have that installed, so I don't need to do it.
But if you would like to have the React native cli, you need to have the pod and that's only for Mac
by the way.
So what you can do here is do you do yarn and then you can run iOS or Android.
I will just do iOS and you can see here we found Xcode project.
So this is our expo project and it's the same way as we would run it from the Xcode.
But this time we run it with the yarn so we can directly run it here and the application is pretty much
the same, but we kind of eject it.
So we lose the expo options that giving us and now we can fully control it.
The build and all assets and everything, the configuration on our own.
And we can actually create our own native plugin and use it in this inside the application.
So that's, that's the option.
And if you will start straight away with this option, react native CLI Quickstart, then you will have
something like like here.
So I don't really recommend it that much because it's not really, it doesn't give you that much power,
it just gives you many cons for using that.
So maybe Expo is a little bit slower.
You still have that like embedded application inside the Expo application, so you won't be able to
see the icon and everything like this.
In fact, Expo gives you a lot of good things.
So I wouldn't if I don't if you don't have to go this route, then don't do it.
And this error failed.
On build iOS.
We run Expo build command but exited with error 65.
I have no idea what is that?
So I will need to debug it, but I'm not going to bother to do it because I just wanted to show you
what will be the way to a m to eject it and what will be the results.
Basically the result is actually I think it's still building that.
So I might have that built in a second anyway.
So you have iOS and then Android folders here and you can maintain that by yourself and having Expo
ejected from your project.