google-books-search | Google books search using react and google books | User Interface library
kandi X-RAY | google-books-search Summary
kandi X-RAY | google-books-search Summary
This project was bootstrapped with Create React App.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of google-books-search
google-books-search Key Features
google-books-search Examples and Code Snippets
Community Discussions
Trending Discussions on google-books-search
QUESTION
Apologies if this question has been asked before and solved, but I have been searching and haven't had much luck.
I have created an app where a person can search for a book and the results are returned. The problem I am having is when I enter a book title and select the search button an empty array is rendered and then an array with the proper results are returned but not rendered. When I select the search button again the proper results are rendered. I would like the correct results to be rendered on the first click.
I logged the results and it looks like the empty array is being rendered first instead of the correct results. I believe it could be due to the async nature of the API call.
Here is my code:
...ANSWER
Answered 2018-Dec-24 at 03:46Yes your assumption is correct it is due to async operation. Handle promise like this.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install google-books-search
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page