Fireship · @fireship
Expo in 100 Seconds
Uploaded February 22, 2024 · Length 2:39
Summary
expo tutorial for building cross-platform mobile apps with react
- expo
- react native
- cross-platform development
- mobile app development
- javascript
Transcript preview
The first 2 minutes of the transcript. Select a timestamp to watch that moment on YouTube.
- 0:00
Expo an open source tool set for
- 0:02
building Universal native apps on iOS
- 0:04
Android and the web with a single react
- 0:06
code base normally developers need to
- 0:08
write Swift code for apple or cotlin for
- 0:10
Android to build a mobile app and that
- 0:12
sucks if you're a web developer because
- 0:14
now you need to learn two new languages
- 0:16
luckily react native fixes this by using
- 0:18
a JavaScript bridge that allows react
- 0:20
components to represent native UI
- 0:22
components if the code looks like HTML
- 0:24
and CSS but you're actually building
- 0:25
truly native widgets the real deal not
- 0:28
just a web view that's embedded in a
- 0:29
native app and can interact with Native
- 0:31
apis like the camera keyboard and
- 0:33
vibrator pretty cool but here's where
- 0:35
expo comes in first run this command to
- 0:37
generate a project template it takes
- 0:39
care of all the annoying configuration
- 0:40
so you can start writing code right away
- 0:42
inside this project we can use npm to
- 0:44
instantly run this app on iOS Android
- 0:47
and the web by simply running an npm
- 0:49
command and if we go into the code and
- 0:51
make some changes to the UI the app will
- 0:52
hot reload to reflect the changes or you
- 0:54
can test the app in a sandbox with tools
- 0:56
like Expo go what's unique about this
- 0:58
code though is this app Direct directory
- 1:00
which uses file system based routing
- 1:02
very similar to react Frameworks like
- 1:04
nextjs and remix this allows you to
- 1:06
create screens that are automatically
- 1:07
deep linkable on mobile and you can
- 1:09
navigate between them in the UI with the
- 1:11
link component but on mobile platforms
- 1:13
we navigate by pushing and popping
- 1:15
screens to the navigation stack in Expo
- 1:17
we can easily control that behavior with
- 1:19
attributes like push and replace on the
- 1:21
link or use the router module directly
- 1:23
to navigate imperatively in addition the
- 1:25
Expo router can also use layouts to
- 1:27
share UI across multiple pages and also
- 1:29
represent more advanced routing patterns
- 1:31
like tabs and moduls Beyond routing
- 1:33
though Expo provides tons of libraries
- 1:35
for working with Native apis need a
- 1:37
camera use Expo to install the camera
- 1:39
package and simply use the camera view
- 1:41
component in your UI the same goes for
- 1:43
maps sensors and virtually every other
- 1:45
use case and has Integrations with tools
- 1:48
like Firebase and superbase to connect
- 1:50
to backend Cloud infrastructure what's
- 1:51
weird though is you'll notice our
- 1:53
project is missing Android and iOS
- 1:55
directories Expo developed a technique
- 1:57
called continuous native generation
- 1:59
where Native code is generated


