Fetching an API (Simple GET Request) with Loading Spinner in React Native App

  Рет қаралды 27,678

MissCoding

MissCoding

2 жыл бұрын

Hi everyone!
Today I am going to show you how to make a GET request to an API from a React Native app. I will also show you how to use useEffect to ensure the API is only called on the React component mounting. While the API call is loading we will display an ActivityIndicator on screen to indicate loading and improve user experience.
My code is available on GitHub:
github.com/chelseafarley/Reac...
You’ve clearly come here to learn and a free audible trial allows you to increase your learning potential in situations where you may be hands free like at the gym or on your commute. It allows you to spend more time on theory when you aren’t able to watch a screen, so that you can maximise your screen time to pick up technical skills. Try it for free today:
amzn.to/3ECMsom
// ABOUT ME
My name is Chelsea and I started studying software engineering in 2010. I have been working commercially full time since 2014 and have been in various positions from graduate developer to tech lead to solution architect.
I'm a full stack developer with a lot of experience in C# and Javascript but my passion is for mobile development; specifically native iOS development and cross platform using React Native.
I always have many things on the go and am always trying out a new side hustle and failing at it; perhaps you can learn from my mistakes!
Please like and subscribe if you enjoyed this video and want to see more like it!
Have any suggestions on topics you would like to learn more about? Please suggest them in the comments... I would love to help you out while doing a bit of learning myself!
// PRODUCTS USED
I use the following products in the creation of my videos:
Boya MM1 Microphone - amzn.to/3m6kif7
A reasonable quality and reasonably sturdy but cost effective microphone that can be used by both DSLR cameras, mobile phones and laptops
Canon 18-55mm Lens - amzn.to/3IwscFR
A kit lens but a decent quality lens for beginners getting used to a DSLR
Canon EOS Rebel T7 with 18-55mm Lens - amzn.to/3XZauAL
This is the kit I started with it includes the lens linked above and is a great starter camera.
I love Apple devices... These are the ones I use for my channel content creation:
Apple iPhone 13 - amzn.to/3KAUba4
A good all round phone, good for Apple development and recording videos with enough high quality features but at a cheaper price point than the pro versions.
Apple MacBook Pro - amzn.to/3KxrE5q
A nice portable computer for working from anywhere and perfect for iOS development
Apple iPad Air - amzn.to/3xU2k21
Really easy to use for graphic design if required for logos as part of my app development or editing the videos on the go.
Apple Pencil (2nd Generation) - amzn.to/3EBSwNS
For logo and icon design in Affinity Designer app for iPad
Logitech Folio Keyboard Touch - amzn.to/3XUYBM1
Adds keyboard and touchpad to iPad Air, making it easier to use for writing code/eBooks etc. on the go!
DISCLAIMER: Links included in this description might be affiliate links. If you purchase a product or service with the links that I provide I may receive a small commission. There is no additional charge to you! Thank you for supporting my channel so I can continue to provide you with free content each week!
//CONTACT:
Please contact me at: hello@tripwiretech.com
//CRAVING MORE:
You can find links to all my different sites and social media over on Linktree: linktr.ee/misscoding

Пікірлер: 16
@KT-ut9zg
@KT-ut9zg Жыл бұрын
Fantastic! Simply explained and very straightforward. Thanks!
@jobarmure6169
@jobarmure6169 Жыл бұрын
Thx very much for the explanation, very easy to understand
@danyspb9349
@danyspb9349 Жыл бұрын
thank you so much it easy to understand
@benjaminflor2355
@benjaminflor2355 Жыл бұрын
so good teacher
@Draxen
@Draxen 2 жыл бұрын
Yo! Holla from Perth WA! Your accent sounds like you’re from NZ! 🤙 Awesome tutorial 👏 keep up the awesome work
@MissCoding
@MissCoding 2 жыл бұрын
Thanks Jordy! Yes I'm from Auckland, NZ :)
@Draxen
@Draxen 2 жыл бұрын
@@MissCoding Epiccc! Hope it's not too chilli over there atm! Pretty cold here in WA haha
@vlastimilslechta8927
@vlastimilslechta8927 Жыл бұрын
Thank u ! 😊
@faizmasroor
@faizmasroor Жыл бұрын
thanks and love from pakistani mobile app developer .
@rkshanigaming3434
@rkshanigaming3434 2 жыл бұрын
Lovely its really helpfull for me...❤❤
@MissCoding
@MissCoding 2 жыл бұрын
Thank you! If you want to see how to make different types of api requests eg put, post and delete… I have recently uploaded a video covering these!
@lylemccalmont4771
@lylemccalmont4771 Жыл бұрын
Thank you for this @MissCoding - excellent tutorial for simple API connectivity. I get the same error "undefined is not an object (evaluating 'response["bpi"]') If I remove the line return Bitcoin (GBP): {response["bpi"]["GBP"].rate}; and readd it it works first time but then fails every time after. Any idea what the issue is @MissCoding?
@kashif2309
@kashif2309 2 жыл бұрын
I'm getting an error saying "undefined is not an object (evaluating 'response["bpi"]')
@anilokcuoglu
@anilokcuoglu Жыл бұрын
i get the same error can you handled this ?
@christopherquarshie8258
@christopherquarshie8258 Жыл бұрын
Same error any solution?
@mehdimv4808
@mehdimv4808 Жыл бұрын
​@@christopherquarshie8258 First cut the "return Bitcoin (USD): {response["bpi"]["USD"].rate};return Bitcoin (USD): {response["bpi"]["USD"].rate};" and save so the app runs successfully one time, then paste it and save again and it works for some reason!
How To Fetch API In React Native And Render Using Flatlist
20:45
The Awesome Dev
Рет қаралды 10 М.
React Native tutorial #46 API Call | Fetch Rest API
10:28
Code Step By Step
Рет қаралды 6 М.
ИРИНА КАЙРАТОВНА - АЙДАХАР (БЕКА) [MV]
02:51
ГОСТ ENTERTAINMENT
Рет қаралды 3,8 МЛН
ТАМАЕВ vs ВЕНГАЛБИ. ФИНАЛЬНАЯ ГОНКА! BMW M5 против CLS
47:36
We Got Expelled From Scholl After This...
00:10
Jojo Sim
Рет қаралды 62 МЛН
Жайдарман | Туған күн 2024 | Алматы
2:22:55
Jaidarman OFFICIAL / JCI
Рет қаралды 680 М.
Turning bad React code into senior React code
13:10
Cosden Solutions
Рет қаралды 86 М.
#1 Create a Simple Login Screen in React Native
5:15
WithFrame
Рет қаралды 11 М.
Fetching Data in React - Complete Tutorial
29:10
Cosden Solutions
Рет қаралды 90 М.
What’s the Best React Native Storage Option? 🧐
12:53
Simon Grimm
Рет қаралды 32 М.
You are using useFetch WRONG! (I hope you don't)
11:14
Alexander Lichter
Рет қаралды 19 М.
Postman для REST API запросов. Быстрый старт и переменные
16:01
Михаил Непомнящий
Рет қаралды 93 М.
React Proxy | Easiest Fix to CORS Errors
15:52
Sam Meech-Ward
Рет қаралды 79 М.
React Native Login with JWT Auth Context
24:59
Simon Grimm
Рет қаралды 49 М.
1$ vs 500$ ВИРТУАЛЬНАЯ РЕАЛЬНОСТЬ !
23:20
GoldenBurst
Рет қаралды 660 М.
Hisense Official Flagship Store Hisense is the champion What is going on?
0:11
Special Effects Funny 44
Рет қаралды 1,3 МЛН
Secret Wireless charger 😱 #shorts
0:28
Mr DegrEE
Рет қаралды 1,3 МЛН
сюрприз
1:00
Capex0
Рет қаралды 1,6 МЛН
Секретный смартфон Apple без камеры для работы на АЭС
0:22