First, ensure that the SPHttpClient is imported in the web part file.
import { SPHttpClient } from '@microsoft/sp-http';
Then we need a data model of the list of lists, and we do this by adding a file, ISPList.ts, with the following content. As you can see, we are interested in the Title and Id of the list, but also we are going to retrieve a piece of information about the last change in list items and the nice image URL for the list.
export interface ISPList { Title: string; Id: string; LastItemUserModifiedDate: string; ImageUrl: string; }
To be totally honest, we don't need the data model. We could simply use the raw JSON data that is returned from the GET request. But by using the data model, our code becomes a great deal more readable and our natural ability to create bugs is reduced by the strong typing. In case our data model includes a property that is not returned by the request, its value will...