Quantcast
Channel: Render async fetch response as an element in React-Native? - Stack Overflow
Browsing all 3 articles
Browse latest View live

Answer by Andreyco for Render async fetch response as an element in...

Remember, response.json() is asynchronous as well and returns Promise, not data as you expect.Adjust code responsible for fetching to this and you are good to go...componentDidMount() {...

View Article



Answer by Matt Aft for Render async fetch response as an element in...

You can set it so it only renders if data has a length:jsonData = () => (this.state.data.length ? this.state.data.map((rows, i) => (<View...

View Article

Image may be NSFW.
Clik here to view.

Render async fetch response as an element in React-Native?

I have an array of data I'm getting back from an API using fetch. I'm trying to parse and render the json response as elements in my app, however I'm not having any luck, how would I go about fixing my...

View Article
Browsing all 3 articles
Browse latest View live




Latest Images