WEBVTT

00:01.340 --> 00:06.350
There is one last thing I would like to show you before we start doing something useful.

00:06.380 --> 00:07.850
Our own application.

00:07.850 --> 00:14.180
So far we have learned how to use React Native, but in the next section we'll build something our own.

00:14.240 --> 00:18.860
So the last thing I would like to show you is eject.

00:18.890 --> 00:25.980
So basically what is eject is a way to eject expo from our project.

00:26.000 --> 00:29.690
So far we used Expo for everything.

00:29.690 --> 00:36.440
And as I said early in in this section, we have a few ways to do it.

00:36.440 --> 00:43.550
So if you go to React Native main page here and if you scroll down basically the first thing what they

00:43.550 --> 00:46.250
ask you to do is to run this command here.

00:46.250 --> 00:53.690
So basically this command npx react native init my test up will create an application for you, but

00:53.690 --> 00:55.370
it's not going to use expo.

00:55.400 --> 00:58.190
It will use a react native cli.

00:58.790 --> 01:06.990
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

01:06.990 --> 01:09.720
have a React native CLI quickstart.

01:09.960 --> 01:17.700
I picked the expo because it's much easier to to do and there is no good reason for having this CLI.

01:17.940 --> 01:26.100
But if at any point you would like to have your own native plugin built by yourself and control everything

01:26.100 --> 01:29.160
by yourself, then you can eject expo.

01:29.160 --> 01:33.540
So basically you have an expo project and then you can eject it.

01:33.540 --> 01:36.360
So you will end up with this project.

01:36.360 --> 01:42.480
You can still maintain in the code will be the same, but you will lose whatever it's coming good with

01:42.480 --> 01:43.020
Expo.

01:43.020 --> 01:48.660
So Expo can build a binary file for you on both platforms.

01:48.840 --> 01:50.700
It has a lot of components.

01:50.700 --> 01:59.550
So for example, if we go to the Docs Expo IO and you can see here, I'm inside API reference, so any

02:00.330 --> 02:07.470
component here, we have any plugins that are it's a huge library of different things that are available

02:07.470 --> 02:09.870
for us and that's a part of the expo.

02:09.870 --> 02:15.330
So basically if you will eject from Expo, you kind of losing that way.

02:15.330 --> 02:24.600
You can still mark to eject it with SDK Expo, so all the plugins will be also included there, but

02:24.600 --> 02:30.780
there will be no way that you can still develop other things using Expo as you used to do.

02:30.780 --> 02:34.860
So for example, in the API reference you have a lot of things to use.

02:34.860 --> 02:38.490
For example, if you would like to use camera, you have a plugin for that.

02:38.490 --> 02:46.650
So the reason to go react native CLI is for something that Expo doesn't have and if you need to have

02:46.680 --> 02:52.860
that in your application, an expo, lack of that and then there is no plugin for that and you will

02:52.860 --> 02:58.290
need to go for something a native, then you need to eject it and I will show you how we can do it and

02:58.290 --> 03:01.980
how actually our structure will change doing that.

03:01.980 --> 03:04.140
So this is what we have at the moment.

03:04.140 --> 03:05.910
We have Expo and Expo Shirt.

03:05.940 --> 03:11.280
What I will do here is I will do expo eject and enter enter.

03:14.730 --> 03:16.920
So I will make it a little bit bigger.

03:18.580 --> 03:21.490
So how would you like to eject your application?

03:21.490 --> 03:23.530
And you can pick bare.

03:23.560 --> 03:24.370
I would like to bare.

03:24.400 --> 03:27.310
Write a React Native project X pocket.

03:27.340 --> 03:32.980
I will create a log in and with expo account to use React Native and Expo SDK.

03:34.180 --> 03:35.470
Or you can cancel.

03:35.500 --> 03:37.960
I will continue with my current project structure.

03:37.960 --> 03:39.850
So basically I would like to.

03:39.880 --> 03:42.610
What you could do is you have two options.

03:42.610 --> 03:51.040
You can cancel, but you can go bare reactive native project as or you can also include whatever it's

03:51.040 --> 03:52.660
in the Expo Expo kit.

03:52.660 --> 03:58.630
So all the, all the plugins and everything will be included there and it will be still being able to

03:58.630 --> 03:58.900
use.

03:58.900 --> 04:01.000
We haven't used anything from there.

04:01.000 --> 04:02.920
So what I will do is I will do bare.

04:02.920 --> 04:08.260
I would like to bare React native project here and I will show you how this is different.

04:08.980 --> 04:12.250
So how should you app appear on the user's home screen?

04:12.250 --> 04:16.360
We'll need to give it a name so I will do movie mobile.

04:16.360 --> 04:18.380
I'll altogether.

04:19.360 --> 04:21.850
And then I can do the same.

04:25.750 --> 04:27.340
So what is happening here?

04:27.340 --> 04:34.600
You can see on the left hand side, it will create two folders for us, iOS and Android here.

04:34.600 --> 04:40.060
So basically from that point you will need to take care of the project by yourself.

04:40.060 --> 04:44.920
So you need to take care of everything here and it will take a while to eject it.

04:44.920 --> 04:51.490
But pretty much if you go in Android here, I'm not sure it is already have everything here, but you

04:51.490 --> 04:54.040
will have a file that with a configuration.

04:54.040 --> 04:59.440
If you already done some native development then you will be familiar with that.

04:59.440 --> 05:06.040
But basically you have the everything here that you normally could open that with Android studio.

05:06.040 --> 05:07.900
And the same thing with the iOS.

05:07.930 --> 05:11.650
You can open that in Xcode and get it from there.

05:11.650 --> 05:19.810
But this has been ejected, so we kind of lose whatever expo could offer us, but we still can run this

05:19.810 --> 05:20.500
application.

05:20.500 --> 05:27.940
So I can go CD iOS and normally you will need to install Pod.

05:28.630 --> 05:31.780
So I already have that installed, so I don't need to do it.

05:31.780 --> 05:38.860
But if you would like to have the React native cli, you need to have the pod and that's only for Mac

05:39.280 --> 05:40.090
by the way.

05:40.360 --> 05:45.620
So what you can do here is do you do yarn and then you can run iOS or Android.

05:45.640 --> 05:51.460
I will just do iOS and you can see here we found Xcode project.

05:51.460 --> 05:58.720
So this is our expo project and it's the same way as we would run it from the Xcode.

05:58.750 --> 06:04.870
But this time we run it with the yarn so we can directly run it here and the application is pretty much

06:04.870 --> 06:07.330
the same, but we kind of eject it.

06:07.330 --> 06:14.650
So we lose the expo options that giving us and now we can fully control it.

06:14.650 --> 06:19.420
The build and all assets and everything, the configuration on our own.

06:19.420 --> 06:25.000
And we can actually create our own native plugin and use it in this inside the application.

06:25.000 --> 06:26.680
So that's, that's the option.

06:26.680 --> 06:36.310
And if you will start straight away with this option, react native CLI Quickstart, then you will have

06:36.310 --> 06:38.740
something like like here.

06:38.740 --> 06:50.140
So I don't really recommend it that much because it's not really, it doesn't give you that much power,

06:50.140 --> 06:53.290
it just gives you many cons for using that.

06:53.290 --> 06:55.990
So maybe Expo is a little bit slower.

06:55.990 --> 07:02.560
You still have that like embedded application inside the Expo application, so you won't be able to

07:02.560 --> 07:04.510
see the icon and everything like this.

07:04.560 --> 07:09.040
In fact, Expo gives you a lot of good things.

07:09.040 --> 07:14.800
So I wouldn't if I don't if you don't have to go this route, then don't do it.

07:14.800 --> 07:16.660
And this error failed.

07:16.660 --> 07:17.680
On build iOS.

07:17.710 --> 07:21.100
We run Expo build command but exited with error 65.

07:21.100 --> 07:23.230
I have no idea what is that?

07:23.230 --> 07:28.480
So I will need to debug it, but I'm not going to bother to do it because I just wanted to show you

07:28.510 --> 07:34.000
what will be the way to a m to eject it and what will be the results.

07:34.000 --> 07:39.730
Basically the result is actually I think it's still building that.

07:39.730 --> 07:45.220
So I might have that built in a second anyway.

07:45.220 --> 07:55.630
So you have iOS and then Android folders here and you can maintain that by yourself and having Expo

07:55.630 --> 07:57.280
ejected from your project.
