📺 Develpreneur YouTube Episode

Video + transcript

React Native - Put It All together Part 3

2021-12-14 •Youtube

Detailed Notes

In this final segment on React Native: Putting it all together, we revisit all the concepts we have covered to this point. Then we go through how to set up and organize your projects so you can break down your code into smaller more manageable components.

Prior to watching this video please see the previous video on React Navigation here or if you need a refresher check out the first video in the series "Started Using React Native For Your Mobile Applications" here.

React Native: Putting It All Together focuses on: Required Dependencies Text SafeAreaView Image Background Image ScrollView TouchableOpacity Button View NavigationContainer Navigator createStackNavigator Tab navigation Const createBottomTabNavigator Drawer navigation Screen createDrawerNavigator Tab navigation Ionicons {useState} For a full list of components and APIs go to https://reactnative.dev/docs/accessibilityinfo

Additional Resources

React is an open-source, front-end, JavaScript library for building user interfaces or UI components. In addition, Facebook and a community of individual developers and companies help maintain it. Additionally, React can be useful as a base in the development of single-page or mobile applications. Node.js is an open-source, cross-platform, back-end JavaScript runtime environment that runs on the Chrome V8 engine and executes JavaScript code outside a web browser. Visual Studio Code is a free source-code editor made by Microsoft for Windows, Linux, and macOS. In addition, it includes support for debugging, syntax highlighting, intelligent code completion, snippets, code refactoring, and embedded Git. Android software development is the process by which applications are created for devices running the Android operating system. Xcode is Apple's integrated development environment for macOS and is used to develop software for macOS, iOS, iPadOS, watchOS, and tvOS. Finally, this series comes from our mentoring/mastermind classes. These classes are virtual meetings that focus on how to improve our technical skills and build our businesses. After all the goals of each member vary. However, this diversity makes for great discussions and a ton of educational value every time we meet. We hope you enjoy viewing this series as much as we enjoy creating it. As always, this may not be all new to you, but we hope it helps you be a better developer.

Transcript Text
[Music]
so we take sample scroll view
back over to notifications
and now we can import it
components
now instead of scroll view
oh
text
i did not import text style
so
so when you get those error message just
kind of follow through and see what
you're missing
i'm still missing something there
but you kind of get the idea here so you
can break them out you can then stack
your components
looks pretty good
so you can pull it out clean it up
menus pull out styles
we got scroll views
safe area view so remember safe area
view works for ios only
and what that does is it handles that
notch so it puts our code below the
notch
however we do need to add some
additional styles if we're on android
and here is the specific code we can use
for android
so remember we have to import platform
and this is where we use status bar
and so here we're getting the os if it's
android we
get the status bar's current height
otherwise it's zero
let's see what else did we cover we
covered
the only thing i have not touched on is
the tab views
which is just another navigation
so instead of using the navigation
container
we could actually go to
home
so we could change our home stack here
actually instead of using stack
navigation we could use tab navigation
that one
so would look something like this
we wanted a tab navigator
we could create a new navigation
tab
navigator
so we need to make sure we
name it dot js
otherwise it won't recognize our code
and we'll change this guy to
constant
have
you have engaged
[Music]
[Music]
export default
tab navigator
and we need to make sure we include all
of our
inserts
our imports
don't need that one don't need those so
we need navigator container
we have an ion icons
those are the icons that we can set for
the tabs
themselves let's see what else do i have
in here screen route
so let's do screen
tabs
create our
navigator for tab
then we can add our stacks to the tab so
our stack
tab one could be home stacked
import
home stack
and then let's see we got home stack
there should be one more
we have one not have to go we need
our
navigation stack
or
notifications
nope setting stack yeah that's right
that was the stack
there we go
so now if we changed our door navigator
in our app
doing this on the fly this may not work
but we can try
to do our tab navigator oops i gotta
change to tab navigator
refresh
create bottom tab navigator oh i forgot
to import that
navigator
oh telling me it is currently not
installed so i would need to install
that guy
so i need
so one of the things you need to
remember to do
for your projects
is you need to make sure that you
install the the node libraries the
react libraries for those individual
components into your project so if i
stop it
npm install
start
reload
stack two screen forgot to change that
one into settings
okay change the navigator reload
element type invalid
navigator tab
you kind of get the idea though so you
can pull them out and then you just have
to kind of piece through and find the
individual pieces here
so we have our constant so i'm probably
missing a component that i've imported
from another project
then if we want to just go back
to the app
change this guy back to menu
reload
there we go
so that's just a quick and dirty way of
organizing your project into individual
components node screen styles
and assets
and essentially once you're done
each of the components that you're using
should be much smaller and easier to
work with so all you have to do is kind
of plug and play and build your app so
any questions
so uh can we react is it strictly for
just mobile apps only or can it be used
like as a regular programming language
and the reason why i'm asking is like i
have a friend of mine who is uh
who got recently had for uh i mean as a
java programmer then he told me learning
react
so
the react itself can be for application
development
react native
is more for web applications like
websites or mobile apps
okay oh so you can be a programmer
whereby you strictly uh just a react
native program and you don't know any
other language isn't it
yes so it's kind of we briefly touched
on this early on in this course but this
goes back to that analogy of react is
like c
and then react native is like c plus
plugs
so
react is the core for building
applications but then react native
is basically built on top of that core
with all the web components so it's like
you have c which is like the core
programming language for c and all its
functions and libraries but then you
have c plus plus which basically is a
collection
uh it expands on the c library so you
can do a lot more
okay all right
thank you mike
you're welcome
okay there are no more questions
like to thank you guys uh we appreciate
your time and if you'd love to discuss
any of these topics further you can send
us questions comments and suggestions to
us at info at developmenter.com
or you can go to our website
development.com contact us
you can find our videos on vimeo
slash developer or you can find us on
youtube if you go to youtube and just do
a search for developer
our goal is making every developer
better
thanks guys have a great day
[Music]
you
Transcript Segments
1.35

[Music]

26.4

so we take sample scroll view

30.16

back over to notifications

32.559

and now we can import it

39.76

components

43.6

now instead of scroll view

64.32

oh

75.04

text

77.119

i did not import text style

81.36

so

86.799

so when you get those error message just

88.56

kind of follow through and see what

90.799

you're missing

93.04

i'm still missing something there

96

but you kind of get the idea here so you

97.6

can break them out you can then stack

99.68

your components

104.64

looks pretty good

106.24

so you can pull it out clean it up

111.6

menus pull out styles

115.52

we got scroll views

117.759

safe area view so remember safe area

120

view works for ios only

122.719

and what that does is it handles that

124.719

notch so it puts our code below the

127.28

notch

128.8

however we do need to add some

131.12

additional styles if we're on android

134.56

and here is the specific code we can use

137.84

for android

139.12

so remember we have to import platform

141.84

and this is where we use status bar

144.64

and so here we're getting the os if it's

148.08

android we

150.16

get the status bar's current height

152.72

otherwise it's zero

157.44

let's see what else did we cover we

159.599

covered

161.92

the only thing i have not touched on is

164.56

the tab views

166.64

which is just another navigation

170.4

so instead of using the navigation

172.56

container

174.08

we could actually go to

177.04

home

178.64

so we could change our home stack here

180.959

actually instead of using stack

183.36

navigation we could use tab navigation

187.599

that one

189.44

so would look something like this

192.159

we wanted a tab navigator

194.64

we could create a new navigation

200

tab

201.599

navigator

204.72

so we need to make sure we

207.92

name it dot js

210

otherwise it won't recognize our code

214.319

and we'll change this guy to

219.04

constant

222.239

have

224.239

you have engaged

225.62

[Music]

234.06

[Music]

237.36

export default

242.48

tab navigator

245.599

and we need to make sure we include all

247.2

of our

248.64

inserts

250.239

our imports

255.2

don't need that one don't need those so

257.44

we need navigator container

260.799

we have an ion icons

263.28

those are the icons that we can set for

265.6

the tabs

266.84

themselves let's see what else do i have

269.36

in here screen route

272.08

so let's do screen

277.12

tabs

280.479

create our

284.72

navigator for tab

287.68

then we can add our stacks to the tab so

290.4

our stack

294.32

tab one could be home stacked

302.96

import

307.12

home stack

323.039

and then let's see we got home stack

325.52

there should be one more

329.039

we have one not have to go we need

332.24

our

334.08

navigation stack

338.24

or

339.919

notifications

343.28

nope setting stack yeah that's right

345.039

that was the stack

347.36

there we go

351.36

so now if we changed our door navigator

355.039

in our app

357.36

doing this on the fly this may not work

359.6

but we can try

362

to do our tab navigator oops i gotta

364.24

change to tab navigator

367.12

refresh

370.56

create bottom tab navigator oh i forgot

373.039

to import that

377.36

navigator

378.8

oh telling me it is currently not

381.52

installed so i would need to install

383.44

that guy

385.6

so i need

386.88

so one of the things you need to

388.08

remember to do

389.6

for your projects

391.199

is you need to make sure that you

392.84

install the the node libraries the

396.56

react libraries for those individual

398.639

components into your project so if i

400.639

stop it

402.24

npm install

411.44

start

416.8

reload

419.039

stack two screen forgot to change that

421.12

one into settings

432.479

okay change the navigator reload

437.12

element type invalid

440.319

navigator tab

442.8

you kind of get the idea though so you

444.639

can pull them out and then you just have

446.639

to kind of piece through and find the

448.479

individual pieces here

450.88

so we have our constant so i'm probably

452.96

missing a component that i've imported

454.72

from another project

458.88

then if we want to just go back

461.199

to the app

463.039

change this guy back to menu

465.759

reload

468.16

there we go

471.199

so that's just a quick and dirty way of

473.28

organizing your project into individual

475.599

components node screen styles

478.96

and assets

480.639

and essentially once you're done

483.039

each of the components that you're using

485.84

should be much smaller and easier to

487.759

work with so all you have to do is kind

489.68

of plug and play and build your app so

492.639

any questions

494.4

so uh can we react is it strictly for

498.639

just mobile apps only or can it be used

502

like as a regular programming language

504.72

and the reason why i'm asking is like i

506.56

have a friend of mine who is uh

508.639

who got recently had for uh i mean as a

511.28

java programmer then he told me learning

513.76

react

515.919

so

516.959

the react itself can be for application

519.36

development

520.56

react native

522.24

is more for web applications like

525.44

websites or mobile apps

528.24

okay oh so you can be a programmer

530.24

whereby you strictly uh just a react

532.88

native program and you don't know any

534.88

other language isn't it

536.399

yes so it's kind of we briefly touched

539.519

on this early on in this course but this

542.8

goes back to that analogy of react is

545.2

like c

546.399

and then react native is like c plus

548.08

plugs

549.04

so

549.92

react is the core for building

552

applications but then react native

554.48

is basically built on top of that core

557.2

with all the web components so it's like

559.36

you have c which is like the core

561.839

programming language for c and all its

563.839

functions and libraries but then you

565.92

have c plus plus which basically is a

568

collection

569.12

uh it expands on the c library so you

571.6

can do a lot more

573.44

okay all right

575.519

thank you mike

576.72

you're welcome

578.48

okay there are no more questions

580.959

like to thank you guys uh we appreciate

583.12

your time and if you'd love to discuss

584.88

any of these topics further you can send

586.8

us questions comments and suggestions to

589.519

us at info at developmenter.com

592.64

or you can go to our website

593.76

development.com contact us

596.32

you can find our videos on vimeo

599.12

slash developer or you can find us on

601.68

youtube if you go to youtube and just do

603.839

a search for developer

606.079

our goal is making every developer

607.6

better

608.64

thanks guys have a great day

612.51

[Music]

627.04

you