Shadowing Practice: 10 Essential React Native Tips Every Developer Must Know - Learn English Speaking with Video

Kies een oefenmodus

Elke modus opent een volledig scherm oefenruimte.

184 zinnen
Als zinnen te kort of te lang zijn, klik op Bewerken om ze aan te passen.
1
You might have worked with React Native for quite some time, but do you really know all the ins and outs?
2
There are some really small nuggets of wisdom in the React Native docs
3
or from the day -to -day use that I want to share with you,
4
so here are 10 practical tips that you can use in your next
5
React Native project.
6
The first one is a real quick one about lists and something I shared before.
7
If you have an input here and you want to hide that keyboard, there's a simple thing that you can add to your list.
8
So I'm using a flat list here and you can now simply go ahead
9
and add the keyboard dismiss mode and set it to on drag.
10
As a result, I can drag the list and it will automatically close the hardware keyboard whenever I do the drag.
11
Additionally, by the way, you can also quickly make this a really cool animated list.
12
So I can add and remove things.
13
But let's just change this to an animated flat list from React Native Reanimated.
14
And then let's add the item layout animation and let's import the linear transition.
15
So now I should be able to have a smooth transition whenever I remove items
16
or add items with just two little changes to an animated flatlist
17
and the item layout animation and I can also on swipe close my keyboard.
18
The second tip is about the pressable component.
19
In most of my tutorials you're gonna see me use the touchable opacity which works great as a button replacement.
20
However if you are looking for a more extensive
21
and future -proof way to handle touch base input check out the pressable API
22
and if you go into the pressable you see
23
that there's a lot more fine -tuning
24
you can do like on press in on press out where
25
you can change the state of your components let's do a quick example i will just change these items
26
which are currently touchable opacity uh item to oppressable
27
and instead of just using styles item i can actually now use a function where i use the pressed state
28
and use that to set either the opacity
29
or for example the background color
30
and you can even use
31
this press state inside the child values here where I currently have the text of the pressable component.
32
As a result, I can now fine -tune exactly how the click event on
33
that button and how especially the press event works instead of just using a touchable opacity.
34
Tip number three is about dark modes and the appearance of our application.
35
Did you know that you can simply wrap your application using the theme provider from React Navigation
36
and then include the default theme
37
and the dark theme to automatically style the elements from react navigation
38
so in this case you're gonna see
39
that both the status bar uh the top area up here
40
and even the background here
41
because it's using the default background color are changing once i switch the colors here in the simulator this works
42
because we use the use color theme use color theme hook from react native
43
which then updates the color theme to either light or dark
44
and this is applied here in our check wrapped around our application.
45
You can then also drill this down on component level.
46
So whenever you want, you can simply import the color theme
47
and use it as a state to set different styles on your elements.
48
And if you manually want to toggle this, you can use the appearance API and the set color theme to manually save this.
49
This works nice in combination with something like async storage or MMKV.
50
So you can then manually on click toggle this.
51
However, in the simulator, this usually fails especially when I don't hit save
52
so now it should work and I can instantly and easily switch between light and dark mode in my app.
53
Tip number four is once again about colors this time it's about using platform
54
and the platform color API in the application
55
so here's a view with three different buttons and
56
if I go to
57
that same view on my Android emulator you're gonna see for some reason they look different
58
and the reason is
59
that you can use both platform select to switch between different platforms
60
you can actually not only have oh come on please stay open come on stay open
61
you can not only ah this is not possible not only switch between ios
62
and android but also windows mac os web or native
63
and then you can supply specific colors in your style sheet
64
and you can not only have fixed colors
65
but you can also see the platform color here
66
this is a bit more complicated to use especially figuring out the values for Android is somewhat hard
67
you have to get into the Android documentation but
68
if you're interested in this you can actually use the system colors of both iOS
69
and Android if you want a complete
70
and even more native feeling in your application tip 5 is about fonts
71
and especially Google fonts did you know that there's an expo package
72
that you can use that you can simply install
73
and then use all the fonts of google let's check
74
it out i've added the package for the frank rule libra uh font to my application to the layout
75
and i also use the use fonts hook to safely in
76
the beginning of my application load all the custom fonts
77
that i want to use i would usually use and use effect
78
and make sure fonts loaded is ready
79
but nonetheless i can now use them on my page inside of the font family
80
and as a result we see here the bold
81
and the medium one being applied
82
it has never been easier to use google fonts in your
83
react native application than this trust me tip number six is about images
84
when you use the image component
85
and you're loading something over the network for example a really big image like this it can sometimes take time
86
so if i go here it takes a millisecond
87
and there are sometimes images
88
that are even bigger now what you can do is you can actually specify a default source
89
and within that default source you basically set the image
90
that should be deployed a deployed should be displayed
91
while the first image is loading so
92
if I had it like this now I could go into the component
93
and you quickly saw that react native image
94
so I just used my local image because
95
that one should be instantly available you could also have like a simple loader in there as the default source
96
that would work as well and then you can use any kind of big image
97
and while it's loading just by default you display your default source in the image element.
98
Tip number seven is about the text element.
99
If you have a very long text in your application, there are different ways to improve this.
100
So the first way, if you're rendering really long text, is of course have this in a scroll view.
101
But sometimes you also want to limit the number of lines.
102
So you can do number of lines on the text element.
103
Let's set this to five.
104
And this will automatically render only five lines.
105
And at the end, you're going to have three dots.
106
So you don't need any logic if text length is bigger than 120, then render three dots or something.
107
No, you can just set the number of lines.
108
However, if you at the same time also want to still show all the things of your text, because now the text of girls truncated,
109
you could add a property called adjust font size to fit.
110
As a result, this looks quite interesting because in our example, well, eight lines is probably not enough.
111
But now we would be able to actually fit all of this in 20 lines of text
112
Remember this was our initial state
113
and now we would be able to render all of that using adjust font size to fit which will simply
114
Specify whether fun should be scaled down automatically to fit given style constraints
115
This is not always helpful, but it can be a nice fix in some of your applications
116
Tip number eight is about warnings in your application
117
So I recently came across a warning that was well not too interesting to me
118
Let's say you got this one
119
Which of course doesn't come up when I want to show it so encounter two children with the same name
120
Of course, that is something you definitely want to fix
121
However, sometimes there are things that you just want to ignore because they keep appearing
122
Especially if you maybe do a presentation for your customer what you can do is you can simply import lockbox
123
From react native we don't need these fences.
124
That looks interesting and now i could go ahead
125
and use lockbox uh and i got two um
126
or different ways i could ignore all locks
127
or i could ignore specific locks
128
so in my case what i want to ignore is probably encountered uh two children with the same key
129
i can now hit save and let's do a reload again
130
and i go into and boom no more locks
131
and of course the same would work
132
if i would use uh logbox .ignorealllocks that's probably a bit more dangerous uh
133
because it would hide anything that pops up in your application
134
so anyway treat this carefully but if you want some mind space some quiet applications
135
and nothing that pops up
136
while you work on your application simply use logbox to control the logs that appear in your react native app.
137
Tip number nine is about API usage and I was kinda shocked when I saw it.
138
So I was using a local API on localhost port 8080
139
and we see I have a simple block here where I fetch my data from API URL slash test
140
and it worked perfectly fine on iOS.
141
However on Android I get an error fetching data.
142
Why is that the case?
143
Well it turns out that localhost doesn't work on the Android emulator.
144
You gonna have a bad day.
145
What you can do as a result is you can add this little block at the top,
146
which is kinda ugly, but if you put all of your API calls, usually in one or two files,
147
into our custom hooks, that should be easy to treat.
148
So in my case, I grab the environment using the node environment to make sure we're actually running in development.
149
And if we're running in development and the platform is Android, I exchange and patch my API URL, which i usually got from my process environment
150
so instead of using localhost port 8080 i'm now using 10 .0 .2 .2 8080 let's hit save
151
and let's check out my emulator again so
152
if i now go into page 9 voila we have fixed this
153
and we can make api calls to localhost on both ios and android
154
Just as a quick addition to this, because this might be an ugly hack, here's something else that is recommended.
155
So you can also map your port using ADB or down here for ADB devices, you can map the port specifically for your emulator.
156
That's probably a tiny bit better than having additional code.
157
But if you just want to do a quick test, this one will get the job done.
158
Tip number 10 is for all of you who want to build a production application of your React Native application using Expo.
159
So usually you're gonna see you have your own custom defcline even if you do a pre -build
160
It only works when your live reload is up and running
161
But sometimes you just want to have the app installed and leave the room and show it to someone else
162
What you can do to build this kind of standalone application is once
163
you have created your pre -build with Expo Go into Xcode go up here hit edit scheme and under run configuration
164
Here for the build configuration you want to select release
165
Go ahead with that, build the application for your device and there's no more connection to a local server.
166
Additionally you can of course do the same for Android, so open your project up with Android Studio
167
and then at the bottom left you're gonna really small find something called build variants.
168
Inside of build variants you see that everything here is set to debug.
169
And of course for our app I can now change this to release, it would change all of these to release
170
and then I can go up here
171
and deploy the app to either my simulator
172
or of course any kind of connected android device all right
173
that brings us to the end of this quick video
174
I hope you enjoyed this quick run through of 10 different things
175
that I picked up over the years I took note of them
176
I probably will do another video once I reach more than five
177
or ten nodes again in the future
178
but let me know in the comments what is something that you figured out after years of using
179
React Native or you were like, why didn't I know that earlier?
180
Leave a comment down below.
181
And of course, also, if you enjoyed that build process step that I showed you last,
182
here's a video about all the ways how you can build your application with Expo, including pre -builds, EAS, and everything you need to know.
183
Don't forget to hit the like and subscribe button and I will catch you in the next one.
184
So until then, happy coding, Simon.

App downloaden

Alles wat je nodig hebt om vloeiend te spreken

AI UitspraakScoor elke zin
IPA OefeningBeheers elk geluid
WoordenschatBouw je woordenschat op
WoordenspelLeren terwijl je speelt

Zelfde Kanaal

FOR YOU

Aanbevolen Video

Woordenschat en spreektips bij deze les

Deze spreekles is gebaseerd op de video “10 Essential React Native Tips Every Developer Must Know”. Deze woorden komen het vaakst terug: application, color, react, native, android. Deze video bevat 184 zinnen en 2332 woorden om na te spreken. Het gesproken deel duurt 12:00. De spreker praat snel, ongeveer 194 woorden per minuut, dus reken op verbonden en ingeslikte klanken. 84% van de woorden hoort bij de 3.000 meest gebruikte Engelse woorden; de rest kun je beter vooraf bekijken.

Belangrijke woorden in deze video

15 woorden uit de video die het leren waard zijn, met uitspraak en betekenis:

WoordUitspraakBetekenis
react werkwoord/ɹiːˈækt/reageren
android zelfstandig naamwoord/ˈænˌdɹɔɪd/androïde
font zelfstandig naamwoord/fɑnt/lettertype, font
default zelfstandig naamwoord/dɪˈfɔlt/niet-nakoming
component zelfstandig naamwoord/kəmˈpoʊ.nənt/onderdeel, component
element zelfstandig naamwoord/ˈɛləmənt/element
ignore werkwoord/ɪɡˈnɔː/negeren
keyboard zelfstandig naamwoord/ˈki.bɔɹd/toetsenbord, klavier
render werkwoord/ˈɹɛn.dɚ/veroorzaken
custom zelfstandig naamwoord/ˈkʌstəm/manieren, gebruiken
dragon zelfstandig naamwoord/ˈdɹæɡən/draak, lintworm
hook zelfstandig naamwoord/hʊk/haak
import zelfstandig naamwoord/ˈɪm.pɔɹt/import, invoer
layout zelfstandig naamwoord/ˈleɪ.aʊt/indeling
deploy werkwoord/dɪˈplɔɪ/uitrollen

Phrasal verbs die je zult horen

WoordBetekenis
check out werkwoordonderzoeken
figure out werkwoorduitvogelen, er achter komen
come across werkwoordoverkomen
pop up werkwoordopduiken, te voorschijn komen
turn out werkwoorduitvallen, resulteren

Grammatica in deze video

De structuren die de spreker het meest gebruikt, met de exacte woorden uit de video:

StructuurIn de video
Lijdende vorm be + voltooid deelwoord — het gaat om wat er gebeurt, niet om wie het doetis applied · being applied · should be deployed
Present perfect have/has + voltooid deelwoord — iets uit het verleden dat nu nog telthave fixed · i've added · has never been

Uitspraak om op te letten

De spreker gebruikt 29 samentrekkingen en verkorte vormen, zoals you're, gonna, don't. Spreek ze kort uit, zoals je ze hoort.

  • De “th”-klanken: smooth /smuːð/, nonetheless /ˌnʌnðəˈlɛs/
  • De klanken “sh” en “zh”: transition /tɹænˈzɪʃ.ən/, animation /ˌæn.ɪˈmeɪ.ʃən/, navigation /nævɪˈɡeɪʃən/, configuration /kənˌfɪɡ.əˈɹeɪ̯.ʃən/, shock /ʃɔk/
  • Lange woorden — let op de klemtoon: manually /ˈmænj(u)əliː/, simulator /ˈsɪmjəˌleɪtɚ/, animation /ˌæn.ɪˈmeɪ.ʃən/, navigation /nævɪˈɡeɪʃən/, configuration /kənˌfɪɡ.əˈɹeɪ̯.ʃən/

Klanken die Nederlandstaligen lastig vinden:

  • Stemhebbende eindmedeklinker — /b/, /d/, /g/, /z/, /v/ niet verscherpen: android /ˈænˌdɹɔɪd/, keyboard /ˈki.bɔɹd/, package /ˈpæk.ɪd͡ʒ/, node /noʊd/, complicated /ˈkɑm.plɪˌkeɪ.tɪd/
  • /æ/ — opener dan de Nederlandse “e”: react /ɹiːˈækt/, android /ˈænˌdɹɔɪd/, dragon /ˈdɹæɡən/, manually /ˈmænj(u)əliː/, package /ˈpæk.ɪd͡ʒ/
  • /g/ — een harde plofklank, geen Nederlandse “g”: ignore /ɪɡˈnɔː/, dragon /ˈdɹæɡən/, ugly /ˈʌɡli/, navigation /nævɪˈɡeɪʃən/, configuration /kənˌfɪɡ.əˈɹeɪ̯.ʃən/

Zo oefen je met deze video

  1. Luister de hele video één keer zonder te spreken en noteer de woorden die je niet kent.
  2. Begin op 0,75× snelheid, spreek zin voor zin na en ga terug naar normale snelheid zodra het makkelijk gaat.
  3. Neem jezelf op en vergelijk met het origineel; let daarbij op woorden als react, android, font.

Wat is de Shadowing-techniek?

Shadowing is een wetenschappelijk onderbouwde taalleermethode die oorspronkelijk is ontwikkeld voor professionele tolkentraining en gepopulariseerd door polyglot Dr. Alexander Arguelles. De methode is eenvoudig maar krachtig: je luistert naar native Engelse audio en herhaalt het onmiddellijk hardop — als een schaduw die de spreker volgt met slechts 1–2 seconden vertraging. In tegenstelling tot passief luisteren of grammaticadrills, dwingt shadowing je hersenen en mondspieren om echte spraakpatronen tegelijkertijd te verwerken en te reproduceren. Onderzoek toont aan dat het de uitspraaknauwkeurigheid, intonatie, ritme, verbonden spraak, luisterbegrip en spreekvaardigheid aanzienlijk verbetert — waardoor het een van de meest effectieve methoden is voor IELTS Speaking-voorbereiding en echte Engelse communicatie.

Shadowing-techniek: lees de volledige stap-voor-stap-gids →