How to build a news app with JavaScript and React Native

Mohammed Salman on May 05, 2018

Requirements for building the app: A basic understanding of the JavaScript language. Node.js, and react native. Libraries used: moment, react-na... [Read Full]
markdown guide
 

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.

 

Hello,
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?

 
 

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:)

 
 
 

Thank You Mohammed.. I will give it a try 👏🏽👏🏽

 
 

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, 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

 
Sloan, the sloth mascot Comment marked as low quality/non-constructive by the community View code of conduct

why, my app just white screen? any answer, im confused :(

code of conduct - report abuse