The fetch request seems to return empty data when used in web and erroneous data when used in android or iOS. I just need it to work in web. I currently get it displaying empty jsons although I did manage to have it work once but couldn’t replicate it.
{}
{}
Hi Patrick! Thanks for the example. It looks like you are returning a Promise from getSearchResults (it’s an async method) This means you also have to wait for the promise to resolve in componentDidMount. I made a little demo how to do such things with React’s state.
Thank you, I managed to fix the problem. I think you’re right about my bad use of async.
Another issue I ran into was using http instead of https. Even though the request in a regular browser works fine with http, it doesn’t always work with snack.