December 2019
Intermediate to advanced
598 pages
12h 21m
English
We are going to start interacting with the REST API on the home page when displaying the list of unanswered questions. The HomePage component won't actually change, but the getUnansweredQuestions function in QuestionsData.ts will. In getUnansweredQuestions, we'll leverage the native browser fetch function to interact with our REST API. If you haven't already, let's open Visual Studio Code and carry out the following steps:
export const getUnansweredQuestions = async (): Promise<QuestionData[]> => { let unansweredQuestions: QuestionData[] = []; // TODO - call api/questions/unanswered ...