Great post! I might have to go play with this news API sometime.
One possible improvement in code clarity: in your getNews function, should this
let result = await fetch(url).then(response => response).then(response => response.json());
be replaced with this?
let result = await fetch(url).then(response => response.json());
Since you're just passing it along to the next then call, it seems redundant to me and could be removed to make the code a little more clear. If you do have a reason for doing it that way, I'd love to hear why!
thanks, i might've forgot that i added the await keyword.
I have found similar article related to react native, hope this will be helpful to create first reactapp : skptricks.com/2018/06/how-to-creat...
I'm stuck at the fetch section... It keeps giving me Network request failed error, however I can manage to request using the same code in chrome console or using other api, any idea?
Network request failed
what is your device?
Thanks for reply, I was developing with Genymotion, I tried a real device after you brought it up and it worked.. that's weird, thanks anyway :)
Maybe because fetch doesn't work with old android devices.
You're welcome anyways:)
What are you use of theme for this syntax in your Code Editor?
Thx Mohammed, nice post!
happy you liked it:)
Thank You Mohammed.. I will give it a try 👏🏽👏🏽
Sure thing, thanks for reading👍
What are you use of theme for syntax in your Code EDITOR
Sorry for the late reply, I use Relaxed color theme, indent-rainbow and Rainbow Brackets plugins for VS Code:)
Hello All, I have implemented CardView for react-native with elevation, that support android(All version) and iOS. github.com/Kishanjvaghela/react-na.... Check this out
This seems awesome, are you planning to do more such tutorials that'd be awesome
Yes, I will definitely be making more of these:)
Hey Mohammed, you might want to hide your api key?
Thanks, i fixed the issue:)
Can I search for specific articles in the api
Hey, very nice site. I came across this on Google, and I am stoked that I did. I will definitely be coming back here more often. Wish I could add to the conversation and bring a bit more to the table, but am just taking in as much info as I can at the moment. Thanks for sharing.
React Native Development Company
why, my app just white screen? any answer, im confused :(
We're a place where coders share, stay up-to-date and grow their careers.
We strive for transparency and don't collect excess data.